[libcxx-commits] [llvm] [libcxx] [libc++] Format the code base (PR #74334)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Dec 4 08:03:52 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Louis Dionne (ldionne)
<details>
<summary>Changes</summary>
This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review.
This patch was generated with:
find libcxx/include libcxx/src -type f | grep -v 'module.modulemap.in' | grep -v 'CMakeLists.txt' | grep -v 'README.txt' | xargs clang-format -i
[1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all
---
Patch is 7.62 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/74334.diff
549 Files Affected:
- (added) .gitattributes (+142)
- (modified) libcxx/include/__algorithm/binary_search.h (+7-13)
- (modified) libcxx/include/__algorithm/comp_ref_type.h (+28-38)
- (modified) libcxx/include/__algorithm/copy_backward.h (+6-10)
- (modified) libcxx/include/__algorithm/copy_if.h (+9-14)
- (modified) libcxx/include/__algorithm/copy_move_common.h (+11-14)
- (modified) libcxx/include/__algorithm/copy_n.h (+29-30)
- (modified) libcxx/include/__algorithm/equal.h (+23-6)
- (modified) libcxx/include/__algorithm/equal_range.h (+4-7)
- (modified) libcxx/include/__algorithm/fill.h (+10-16)
- (modified) libcxx/include/__algorithm/fill_n.h (+8-12)
- (modified) libcxx/include/__algorithm/find_end.h (+45-47)
- (modified) libcxx/include/__algorithm/find_first_of.h (+12-9)
- (modified) libcxx/include/__algorithm/for_each_n.h (+2-3)
- (modified) libcxx/include/__algorithm/generate.h (+4-6)
- (modified) libcxx/include/__algorithm/generate_n.h (+7-9)
- (modified) libcxx/include/__algorithm/half_positive.h (+4-10)
- (modified) libcxx/include/__algorithm/in_found_result.h (+1-1)
- (modified) libcxx/include/__algorithm/in_fun_result.h (+1-1)
- (modified) libcxx/include/__algorithm/in_in_out_result.h (+6-8)
- (modified) libcxx/include/__algorithm/in_in_result.h (+2-4)
- (modified) libcxx/include/__algorithm/in_out_out_result.h (+6-8)
- (modified) libcxx/include/__algorithm/in_out_result.h (+3-5)
- (modified) libcxx/include/__algorithm/includes.h (+18-13)
- (modified) libcxx/include/__algorithm/inplace_merge.h (+144-160)
- (modified) libcxx/include/__algorithm/is_heap.h (+7-13)
- (modified) libcxx/include/__algorithm/is_heap_until.h (+26-30)
- (modified) libcxx/include/__algorithm/is_partitioned.h (+10-11)
- (modified) libcxx/include/__algorithm/is_permutation.h (+121-56)
- (modified) libcxx/include/__algorithm/is_sorted.h (+7-13)
- (modified) libcxx/include/__algorithm/is_sorted_until.h (+14-19)
- (modified) libcxx/include/__algorithm/iter_swap.h (+1-2)
- (modified) libcxx/include/__algorithm/iterator_operations.h (+30-37)
- (modified) libcxx/include/__algorithm/lexicographical_compare.h (+23-26)
- (modified) libcxx/include/__algorithm/lower_bound.h (+7-8)
- (modified) libcxx/include/__algorithm/make_heap.h (+8-8)
- (modified) libcxx/include/__algorithm/make_projected.h (+20-27)
- (modified) libcxx/include/__algorithm/max.h (+13-26)
- (modified) libcxx/include/__algorithm/max_element.h (+14-19)
- (modified) libcxx/include/__algorithm/merge.h (+33-32)
- (modified) libcxx/include/__algorithm/min.h (+13-26)
- (modified) libcxx/include/__algorithm/min_element.h (+10-13)
- (modified) libcxx/include/__algorithm/min_max_result.h (+1-1)
- (modified) libcxx/include/__algorithm/minmax.h (+19-29)
- (modified) libcxx/include/__algorithm/minmax_element.h (+15-16)
- (modified) libcxx/include/__algorithm/mismatch.h (+12-13)
- (modified) libcxx/include/__algorithm/move.h (+1-2)
- (modified) libcxx/include/__algorithm/move_backward.h (+3-3)
- (modified) libcxx/include/__algorithm/next_permutation.h (+27-34)
- (modified) libcxx/include/__algorithm/nth_element.h (+184-202)
- (modified) libcxx/include/__algorithm/partial_sort.h (+15-24)
- (modified) libcxx/include/__algorithm/partial_sort_copy.h (+54-40)
- (modified) libcxx/include/__algorithm/partition.h (+36-48)
- (modified) libcxx/include/__algorithm/partition_copy.h (+16-20)
- (modified) libcxx/include/__algorithm/partition_point.h (+15-19)
- (modified) libcxx/include/__algorithm/pop_heap.h (+10-8)
- (modified) libcxx/include/__algorithm/prev_permutation.h (+28-36)
- (modified) libcxx/include/__algorithm/push_heap.h (+13-11)
- (modified) libcxx/include/__algorithm/remove.h (+11-15)
- (modified) libcxx/include/__algorithm/remove_copy.h (+8-12)
- (modified) libcxx/include/__algorithm/remove_copy_if.h (+8-12)
- (modified) libcxx/include/__algorithm/remove_if.h (+11-15)
- (modified) libcxx/include/__algorithm/replace.h (+5-7)
- (modified) libcxx/include/__algorithm/replace_copy.h (+12-11)
- (modified) libcxx/include/__algorithm/replace_copy_if.h (+12-11)
- (modified) libcxx/include/__algorithm/replace_if.h (+5-7)
- (modified) libcxx/include/__algorithm/reverse.h (+16-24)
- (modified) libcxx/include/__algorithm/reverse_copy.h (+5-7)
- (modified) libcxx/include/__algorithm/rotate.h (+118-146)
- (modified) libcxx/include/__algorithm/rotate_copy.h (+3-5)
- (modified) libcxx/include/__algorithm/sample.h (+46-35)
- (modified) libcxx/include/__algorithm/search.h (+55-68)
- (modified) libcxx/include/__algorithm/search_n.h (+34-62)
- (modified) libcxx/include/__algorithm/set_difference.h (+1-1)
- (modified) libcxx/include/__algorithm/shift_left.h (+21-22)
- (modified) libcxx/include/__algorithm/shift_right.h (+61-62)
- (modified) libcxx/include/__algorithm/shuffle.h (+60-67)
- (modified) libcxx/include/__algorithm/sift_down.h (+70-71)
- (modified) libcxx/include/__algorithm/sort.h (+143-102)
- (modified) libcxx/include/__algorithm/sort_heap.h (+8-8)
- (modified) libcxx/include/__algorithm/stable_partition.h (+230-257)
- (modified) libcxx/include/__algorithm/stable_sort.h (+160-172)
- (modified) libcxx/include/__algorithm/swap_ranges.h (+3-6)
- (modified) libcxx/include/__algorithm/transform.h (+14-15)
- (modified) libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h (+5-9)
- (modified) libcxx/include/__algorithm/unwrap_iter.h (+5-5)
- (modified) libcxx/include/__atomic/atomic.h (+339-473)
- (modified) libcxx/include/__atomic/atomic_base.h (+147-174)
- (modified) libcxx/include/__atomic/atomic_flag.h (+88-158)
- (modified) libcxx/include/__atomic/atomic_lock_free.h (+26-26)
- (modified) libcxx/include/__atomic/atomic_sync.h (+43-47)
- (modified) libcxx/include/__atomic/check_memory_order.h (+9-13)
- (modified) libcxx/include/__atomic/contention_t.h (+2-2)
- (modified) libcxx/include/__atomic/cxx_atomic_impl.h (+254-306)
- (modified) libcxx/include/__atomic/fence.h (+3-13)
- (modified) libcxx/include/__atomic/kill_dependency.h (+2-4)
- (modified) libcxx/include/__atomic/memory_order.h (+2-9)
- (modified) libcxx/include/__availability (+82-68)
- (modified) libcxx/include/__bit/bit_cast.h (+1-2)
- (modified) libcxx/include/__bit/bit_ceil.h (+1-1)
- (modified) libcxx/include/__bit/byteswap.h (+5-6)
- (modified) libcxx/include/__bit/countl.h (+41-43)
- (modified) libcxx/include/__bit/countr.h (+10-7)
- (modified) libcxx/include/__bit/endian.h (+1-1)
- (modified) libcxx/include/__bit/popcount.h (+9-6)
- (modified) libcxx/include/__chrono/calendar.h (+6-6)
- (modified) libcxx/include/__chrono/convert_to_timespec.h (+5-10)
- (modified) libcxx/include/__chrono/day.h (+53-38)
- (modified) libcxx/include/__chrono/duration.h (+320-373)
- (modified) libcxx/include/__chrono/file_clock.h (+10-14)
- (modified) libcxx/include/__chrono/formatter.h (+27-36)
- (modified) libcxx/include/__chrono/hh_mm_ss.h (+53-58)
- (modified) libcxx/include/__chrono/high_resolution_clock.h (+1-2)
- (modified) libcxx/include/__chrono/literals.h (+10-14)
- (modified) libcxx/include/__chrono/month.h (+53-41)
- (modified) libcxx/include/__chrono/month_weekday.h (+56-48)
- (modified) libcxx/include/__chrono/monthday.h (+67-64)
- (modified) libcxx/include/__chrono/steady_clock.h (+8-10)
- (modified) libcxx/include/__chrono/system_clock.h (+11-13)
- (modified) libcxx/include/__chrono/time_point.h (+81-105)
- (modified) libcxx/include/__chrono/weekday.h (+106-95)
- (modified) libcxx/include/__chrono/year.h (+60-44)
- (modified) libcxx/include/__chrono/year_month.h (+62-49)
- (modified) libcxx/include/__chrono/year_month_day.h (+256-204)
- (modified) libcxx/include/__chrono/year_month_weekday.h (+205-164)
- (modified) libcxx/include/__compare/common_comparison_category.h (+9-18)
- (modified) libcxx/include/__compare/compare_partial_order_fallback.h (+35-33)
- (modified) libcxx/include/__compare/compare_strong_order_fallback.h (+32-30)
- (modified) libcxx/include/__compare/compare_three_way.h (+9-10)
- (modified) libcxx/include/__compare/compare_three_way_result.h (+12-11)
- (modified) libcxx/include/__compare/compare_weak_order_fallback.h (+32-30)
- (modified) libcxx/include/__compare/ordering.h (+58-106)
- (modified) libcxx/include/__compare/partial_order.h (+32-31)
- (modified) libcxx/include/__compare/strong_order.h (+86-87)
- (modified) libcxx/include/__compare/three_way_comparable.h (+16-20)
- (modified) libcxx/include/__compare/weak_order.h (+57-58)
- (modified) libcxx/include/__config (+2-2)
- (modified) libcxx/include/__config_site.in (+5-6)
- (modified) libcxx/include/__coroutine/coroutine_handle.h (+116-141)
- (modified) libcxx/include/__coroutine/coroutine_traits.h (+2-7)
- (modified) libcxx/include/__coroutine/noop_coroutine_handle.h (+45-58)
- (modified) libcxx/include/__coroutine/trivial_awaitables.h (+6-12)
- (modified) libcxx/include/__debug_utils/randomize_range.h (+1-2)
- (modified) libcxx/include/__expected/expected.h (+84-121)
- (modified) libcxx/include/__filesystem/copy_options.h (+20-30)
- (modified) libcxx/include/__filesystem/directory_entry.h (+81-170)
- (modified) libcxx/include/__filesystem/directory_iterator.h (+25-48)
- (modified) libcxx/include/__filesystem/directory_options.h (+12-32)
- (modified) libcxx/include/__filesystem/file_status.h (+10-18)
- (modified) libcxx/include/__filesystem/file_type.h (+7-7)
- (modified) libcxx/include/__filesystem/operations.h (+167-57)
- (modified) libcxx/include/__filesystem/path.h (+242-410)
- (modified) libcxx/include/__filesystem/path_iterator.h (+17-33)
- (modified) libcxx/include/__filesystem/perm_options.h (+12-27)
- (modified) libcxx/include/__filesystem/perms.h (+23-33)
- (modified) libcxx/include/__filesystem/recursive_directory_iterator.h (+31-54)
- (modified) libcxx/include/__filesystem/u8path.h (+21-27)
- (modified) libcxx/include/__format/buffer.h (+20-20)
- (modified) libcxx/include/__format/concepts.h (+1-1)
- (modified) libcxx/include/__format/escaped_output_table.h (+100-893)
- (modified) libcxx/include/__format/extended_grapheme_cluster_table.h (+167-1496)
- (modified) libcxx/include/__format/format_arg.h (+13-19)
- (modified) libcxx/include/__format/format_arg_store.h (+7-7)
- (modified) libcxx/include/__format/format_args.h (+2-3)
- (modified) libcxx/include/__format/format_context.h (+29-43)
- (modified) libcxx/include/__format/format_error.h (+7-10)
- (modified) libcxx/include/__format/format_functions.h (+87-94)
- (modified) libcxx/include/__format/format_parse_context.h (+11-19)
- (modified) libcxx/include/__format/format_string.h (+6-14)
- (modified) libcxx/include/__format/formatter.h (+2-2)
- (modified) libcxx/include/__format/formatter_floating_point.h (+41-51)
- (modified) libcxx/include/__format/formatter_integer.h (+13-24)
- (modified) libcxx/include/__format/formatter_integral.h (+25-19)
- (modified) libcxx/include/__format/formatter_output.h (+6-4)
- (modified) libcxx/include/__format/formatter_pointer.h (+3-6)
- (modified) libcxx/include/__format/formatter_string.h (+8-10)
- (modified) libcxx/include/__format/parser_std_format_spec.h (+40-39)
- (modified) libcxx/include/__format/unicode.h (+4-6)
- (modified) libcxx/include/__format/write_escaped.h (+9-10)
- (modified) libcxx/include/__functional/binary_function.h (+8-8)
- (modified) libcxx/include/__functional/binary_negate.h (+13-12)
- (modified) libcxx/include/__functional/bind.h (+164-223)
- (modified) libcxx/include/__functional/bind_back.h (+22-12)
- (modified) libcxx/include/__functional/bind_front.h (+10-11)
- (modified) libcxx/include/__functional/binder1st.h (+18-17)
- (modified) libcxx/include/__functional/binder2nd.h (+18-17)
- (modified) libcxx/include/__functional/boyer_moore_searcher.h (+57-71)
- (modified) libcxx/include/__functional/compose.h (+15-12)
- (modified) libcxx/include/__functional/default_searcher.h (+14-17)
- (modified) libcxx/include/__functional/function.h (+725-922)
- (modified) libcxx/include/__functional/hash.h (+271-411)
- (modified) libcxx/include/__functional/identity.h (+5-6)
- (modified) libcxx/include/__functional/invoke.h (+14-16)
- (modified) libcxx/include/__functional/is_transparent.h (+1-2)
- (modified) libcxx/include/__functional/mem_fn.h (+16-20)
- (modified) libcxx/include/__functional/mem_fun_ref.h (+78-105)
- (modified) libcxx/include/__functional/not_fn.h (+11-14)
- (modified) libcxx/include/__functional/operations.h (+237-303)
- (modified) libcxx/include/__functional/perfect_forward.h (+25-23)
- (modified) libcxx/include/__functional/pointer_to_binary_function.h (+9-11)
- (modified) libcxx/include/__functional/pointer_to_unary_function.h (+9-11)
- (modified) libcxx/include/__functional/ranges_operations.h (+12-12)
- (modified) libcxx/include/__functional/reference_wrapper.h (+44-53)
- (modified) libcxx/include/__functional/unary_function.h (+6-6)
- (modified) libcxx/include/__functional/unary_negate.h (+13-12)
- (modified) libcxx/include/__functional/weak_result_type.h (+81-144)
- (modified) libcxx/include/__fwd/get.h (+16-32)
- (modified) libcxx/include/__fwd/span.h (+2-1)
- (modified) libcxx/include/__fwd/string_view.h (+4-4)
- (modified) libcxx/include/__fwd/subrange.h (+1-1)
- (modified) libcxx/include/__hash_table (+1353-1861)
- (modified) libcxx/include/__ios/fpos.h (+3-6)
- (modified) libcxx/include/__iterator/access.h (+21-46)
- (modified) libcxx/include/__iterator/advance.h (+26-31)
- (modified) libcxx/include/__iterator/back_insert_iterator.h (+30-23)
- (modified) libcxx/include/__iterator/common_iterator.h (+102-109)
- (modified) libcxx/include/__iterator/concepts.h (+145-193)
- (modified) libcxx/include/__iterator/counted_iterator.h (+80-111)
- (modified) libcxx/include/__iterator/data.h (+15-17)
- (modified) libcxx/include/__iterator/default_sentinel.h (+1-1)
- (modified) libcxx/include/__iterator/distance.h (+20-29)
- (modified) libcxx/include/__iterator/empty.h (+10-9)
- (modified) libcxx/include/__iterator/erase_if_container.h (+1-3)
- (modified) libcxx/include/__iterator/front_insert_iterator.h (+29-22)
- (modified) libcxx/include/__iterator/incrementable_traits.h (+17-16)
- (modified) libcxx/include/__iterator/indirectly_comparable.h (+1-2)
- (modified) libcxx/include/__iterator/insert_iterator.h (+33-24)
- (modified) libcxx/include/__iterator/istream_iterator.h (+45-50)
- (modified) libcxx/include/__iterator/istreambuf_iterator.h (+60-71)
- (modified) libcxx/include/__iterator/iter_move.h (+31-37)
- (modified) libcxx/include/__iterator/iter_swap.h (+43-56)
- (modified) libcxx/include/__iterator/iterator.h (+7-9)
- (modified) libcxx/include/__iterator/iterator_traits.h (+186-211)
- (modified) libcxx/include/__iterator/mergeable.h (+8-7)
- (modified) libcxx/include/__iterator/move_iterator.h (+203-216)
- (modified) libcxx/include/__iterator/move_sentinel.h (+9-12)
- (modified) libcxx/include/__iterator/next.h (+5-8)
- (modified) libcxx/include/__iterator/ostream_iterator.h (+29-26)
- (modified) libcxx/include/__iterator/ostreambuf_iterator.h (+28-33)
- (modified) libcxx/include/__iterator/permutable.h (+1-2)
- (modified) libcxx/include/__iterator/prev.h (+5-8)
- (modified) libcxx/include/__iterator/readable_traits.h (+23-23)
- (modified) libcxx/include/__iterator/reverse_access.h (+20-40)
- (modified) libcxx/include/__iterator/reverse_iterator.h (+175-191)
- (modified) libcxx/include/__iterator/size.h (+16-16)
- (modified) libcxx/include/__iterator/sortable.h (+1-3)
- (modified) libcxx/include/__iterator/unreachable_sentinel.h (+2-3)
- (modified) libcxx/include/__iterator/wrap_iter.h (+122-136)
- (modified) libcxx/include/__locale (+1096-1338)
- (modified) libcxx/include/__locale_dir/locale_base_api/bsd_locale_defaults.h (+14-14)
- (modified) libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h (+61-83)
- (modified) libcxx/include/__locale_dir/locale_base_api/locale_guard.h (+33-34)
- (modified) libcxx/include/__mbstate_t.h (+8-8)
- (modified) libcxx/include/__memory/addressof.h (+10-25)
- (modified) libcxx/include/__memory/aligned_alloc.h (+20-22)
- (modified) libcxx/include/__memory/allocate_at_least.h (+5-5)
- (modified) libcxx/include/__memory/allocation_guard.h (+45-53)
- (modified) libcxx/include/__memory/allocator.h (+160-171)
- (modified) libcxx/include/__memory/allocator_arg_t.h (+20-25)
- (modified) libcxx/include/__memory/allocator_destructor.h (+11-13)
- (modified) libcxx/include/__memory/allocator_traits.h (+185-194)
- (modified) libcxx/include/__memory/assume_aligned.h (+1-2)
- (modified) libcxx/include/__memory/auto_ptr.h (+51-43)
- (modified) libcxx/include/__memory/builtin_new_allocator.h (+10-13)
- (modified) libcxx/include/__memory/compressed_pair.h (+35-46)
- (modified) libcxx/include/__memory/concepts.h (+4-11)
- (modified) libcxx/include/__memory/construct_at.h (+29-36)
- (modified) libcxx/include/__memory/destruct_n.h (+30-31)
- (modified) libcxx/include/__memory/pointer_traits.h (+86-88)
- (modified) libcxx/include/__memory/ranges_construct_at.h (+11-17)
- (modified) libcxx/include/__memory/ranges_uninitialized_algorithms.h (+43-46)
- (modified) libcxx/include/__memory/raw_storage_iterator.h (+39-27)
- (modified) libcxx/include/__memory/shared_ptr.h (+1027-1468)
- (modified) libcxx/include/__memory/temp_value.h (+17-15)
- (modified) libcxx/include/__memory/temporary_buffer.h (+34-44)
- (modified) libcxx/include/__memory/uninitialized_algorithms.h (+224-237)
- (modified) libcxx/include/__memory/unique_ptr.h (+143-230)
- (modified) libcxx/include/__memory/uses_allocator.h (+10-17)
- (modified) libcxx/include/__node_handle (+87-137)
- (modified) libcxx/include/__numeric/accumulate.h (+12-16)
- (modified) libcxx/include/__numeric/adjacent_difference.h (+24-33)
- (modified) libcxx/include/__numeric/exclusive_scan.h (+1-1)
- (modified) libcxx/include/__numeric/gcd_lcm.h (+36-46)
- (modified) libcxx/include/__numeric/inclusive_scan.h (+4-5)
- (modified) libcxx/include/__numeric/inner_product.h (+17-17)
- (modified) libcxx/include/__numeric/iota.h (+4-6)
- (modified) libcxx/include/__numeric/midpoint.h (+29-34)
- (modified) libcxx/include/__numeric/partial_sum.h (+22-31)
- (modified) libcxx/include/__numeric/reduce.h (+4-4)
- (modified) libcxx/include/__numeric/transform_exclusive_scan.h (+13-20)
- (modified) libcxx/include/__numeric/transform_inclusive_scan.h (+18-24)
- (modified) libcxx/include/__numeric/transform_reduce.h (+13-12)
- (modified) libcxx/include/__random/bernoulli_distribution.h (+69-91)
- (modified) libcxx/include/__random/binomial_distribution.h (+130-161)
- (modified) libcxx/include/__random/cauchy_distribution.h (+83-111)
- (modified) libcxx/include/__random/chi_squared_distribution.h (+69-92)
- (modified) libcxx/include/__random/clamp_to_integral.h (+11-11)
- (modified) libcxx/include/__random/discard_block_engine.h (+113-143)
- (modified) libcxx/include/__random/discrete_distribution.h (+144-196)
- (modified) libcxx/include/__random/exponential_distribution.h (+72-100)
- (modified) libcxx/include/__random/extreme_value_distribution.h (+84-112)
- (modified) libcxx/include/__random/fisher_f_distribution.h (+83-111)
- (modified) libcxx/include/__random/gamma_distribution.h (+121-159)
- (modified) libcxx/include/__random/generate_canonical.h (+13-15)
- (modified) libcxx/include/__random/geometric_distribution.h (+67-90)
- (modified) libcxx/include/__random/independent_bits_engine.h (+139-192)
- (modified) libcxx/include/__random/is_seed_sequence.h (+3-5)
- (modified) libcxx/include/__random/is_valid.h (+34-19)
- (modified) libcxx/include/__random/linear_congruential_engine.h (+211-280)
- (modified) libcxx/include/__random/log2.h (+17-22)
- (modified) libcxx/include/__random/lognormal_distribution.h (+75-114)
- (modified) libcxx/include/__random/mersenne_twister_engine.h (+813-411)
- (modified) libcxx/include/__random/negative_binomial_distribution.h (+102-130)
- (modified) libcxx/include/__random/normal_distribution.h (+120-158)
- (modified) libcxx/include/__random/piecewise_constant_distribution.h (+224-284)
- (modified) libcxx/include/__random/piecewise_linear_distribution.h (+238-300)
- (modified) libcxx/include/__random/poisson_distribution.h (+176-216)
- (modified) libcxx/include/__random/random_device.h (+42-45)
- (modified) libcxx/include/__random/ranlux.h (+1-1)
``````````diff
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000000..6b281f33f737d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,142 @@
+libcxx/src/**/*.cpp merge=libcxx-reformat
+libcxx/include/**/*.h merge=libcxx-reformat
+
+# Explicitly handle files with no extension
+libcxx/include/__availability merge=libcxx-reformat
+libcxx/include/__bit_reference merge=libcxx-reformat
+libcxx/include/__config merge=libcxx-reformat
+libcxx/include/__hash_table merge=libcxx-reformat
+libcxx/include/__locale merge=libcxx-reformat
+libcxx/include/__node_handle merge=libcxx-reformat
+libcxx/include/__split_buffer merge=libcxx-reformat
+libcxx/include/__std_clang_module merge=libcxx-reformat
+libcxx/include/__threading_support merge=libcxx-reformat
+libcxx/include/__tree merge=libcxx-reformat
+libcxx/include/__verbose_abort merge=libcxx-reformat
+libcxx/include/algorithm merge=libcxx-reformat
+libcxx/include/any merge=libcxx-reformat
+libcxx/include/array merge=libcxx-reformat
+libcxx/include/atomic merge=libcxx-reformat
+libcxx/include/barrier merge=libcxx-reformat
+libcxx/include/bit merge=libcxx-reformat
+libcxx/include/bitset merge=libcxx-reformat
+libcxx/include/cassert merge=libcxx-reformat
+libcxx/include/ccomplex merge=libcxx-reformat
+libcxx/include/cctype merge=libcxx-reformat
+libcxx/include/cerrno merge=libcxx-reformat
+libcxx/include/cfenv merge=libcxx-reformat
+libcxx/include/cfloat merge=libcxx-reformat
+libcxx/include/charconv merge=libcxx-reformat
+libcxx/include/chrono merge=libcxx-reformat
+libcxx/include/cinttypes merge=libcxx-reformat
+libcxx/include/ciso646 merge=libcxx-reformat
+libcxx/include/climits merge=libcxx-reformat
+libcxx/include/clocale merge=libcxx-reformat
+libcxx/include/cmath merge=libcxx-reformat
+libcxx/include/codecvt merge=libcxx-reformat
+libcxx/include/compare merge=libcxx-reformat
+libcxx/include/complex merge=libcxx-reformat
+libcxx/include/concepts merge=libcxx-reformat
+libcxx/include/condition_variable merge=libcxx-reformat
+libcxx/include/coroutine merge=libcxx-reformat
+libcxx/include/csetjmp merge=libcxx-reformat
+libcxx/include/csignal merge=libcxx-reformat
+libcxx/include/cstdarg merge=libcxx-reformat
+libcxx/include/cstdbool merge=libcxx-reformat
+libcxx/include/cstddef merge=libcxx-reformat
+libcxx/include/cstdint merge=libcxx-reformat
+libcxx/include/cstdio merge=libcxx-reformat
+libcxx/include/cstdlib merge=libcxx-reformat
+libcxx/include/cstring merge=libcxx-reformat
+libcxx/include/ctgmath merge=libcxx-reformat
+libcxx/include/ctime merge=libcxx-reformat
+libcxx/include/cuchar merge=libcxx-reformat
+libcxx/include/cwchar merge=libcxx-reformat
+libcxx/include/cwctype merge=libcxx-reformat
+libcxx/include/deque merge=libcxx-reformat
+libcxx/include/exception merge=libcxx-reformat
+libcxx/include/execution merge=libcxx-reformat
+libcxx/include/expected merge=libcxx-reformat
+libcxx/include/experimental/__config merge=libcxx-reformat
+libcxx/include/experimental/__memory merge=libcxx-reformat
+libcxx/include/experimental/deque merge=libcxx-reformat
+libcxx/include/experimental/forward_list merge=libcxx-reformat
+libcxx/include/experimental/iterator merge=libcxx-reformat
+libcxx/include/experimental/list merge=libcxx-reformat
+libcxx/include/experimental/map merge=libcxx-reformat
+libcxx/include/experimental/memory merge=libcxx-reformat
+libcxx/include/experimental/memory_resource merge=libcxx-reformat
+libcxx/include/experimental/propagate_const merge=libcxx-reformat
+libcxx/include/experimental/regex merge=libcxx-reformat
+libcxx/include/experimental/set merge=libcxx-reformat
+libcxx/include/experimental/simd merge=libcxx-reformat
+libcxx/include/experimental/string merge=libcxx-reformat
+libcxx/include/experimental/type_traits merge=libcxx-reformat
+libcxx/include/experimental/unordered_map merge=libcxx-reformat
+libcxx/include/experimental/unordered_set merge=libcxx-reformat
+libcxx/include/experimental/utility merge=libcxx-reformat
+libcxx/include/experimental/vector merge=libcxx-reformat
+libcxx/include/ext/__hash merge=libcxx-reformat
+libcxx/include/ext/hash_map merge=libcxx-reformat
+libcxx/include/ext/hash_set merge=libcxx-reformat
+libcxx/include/filesystem merge=libcxx-reformat
+libcxx/include/format merge=libcxx-reformat
+libcxx/include/forward_list merge=libcxx-reformat
+libcxx/include/fstream merge=libcxx-reformat
+libcxx/include/functional merge=libcxx-reformat
+libcxx/include/future merge=libcxx-reformat
+libcxx/include/initializer_list merge=libcxx-reformat
+libcxx/include/iomanip merge=libcxx-reformat
+libcxx/include/ios merge=libcxx-reformat
+libcxx/include/iosfwd merge=libcxx-reformat
+libcxx/include/iostream merge=libcxx-reformat
+libcxx/include/istream merge=libcxx-reformat
+libcxx/include/iterator merge=libcxx-reformat
+libcxx/include/latch merge=libcxx-reformat
+libcxx/include/limits merge=libcxx-reformat
+libcxx/include/list merge=libcxx-reformat
+libcxx/include/locale merge=libcxx-reformat
+libcxx/include/map merge=libcxx-reformat
+libcxx/include/mdspan merge=libcxx-reformat
+libcxx/include/memory merge=libcxx-reformat
+libcxx/include/memory_resource merge=libcxx-reformat
+libcxx/include/mutex merge=libcxx-reformat
+libcxx/include/new merge=libcxx-reformat
+libcxx/include/numbers merge=libcxx-reformat
+libcxx/include/numeric merge=libcxx-reformat
+libcxx/include/optional merge=libcxx-reformat
+libcxx/include/ostream merge=libcxx-reformat
+libcxx/include/print merge=libcxx-reformat
+libcxx/include/queue merge=libcxx-reformat
+libcxx/include/random merge=libcxx-reformat
+libcxx/include/ranges merge=libcxx-reformat
+libcxx/include/ratio merge=libcxx-reformat
+libcxx/include/regex merge=libcxx-reformat
+libcxx/include/scoped_allocator merge=libcxx-reformat
+libcxx/include/semaphore merge=libcxx-reformat
+libcxx/include/set merge=libcxx-reformat
+libcxx/include/shared_mutex merge=libcxx-reformat
+libcxx/include/source_location merge=libcxx-reformat
+libcxx/include/span merge=libcxx-reformat
+libcxx/include/sstream merge=libcxx-reformat
+libcxx/include/stack merge=libcxx-reformat
+libcxx/include/stdexcept merge=libcxx-reformat
+libcxx/include/stop_token merge=libcxx-reformat
+libcxx/include/streambuf merge=libcxx-reformat
+libcxx/include/string merge=libcxx-reformat
+libcxx/include/string_view merge=libcxx-reformat
+libcxx/include/strstream merge=libcxx-reformat
+libcxx/include/syncstream merge=libcxx-reformat
+libcxx/include/system_error merge=libcxx-reformat
+libcxx/include/thread merge=libcxx-reformat
+libcxx/include/tuple merge=libcxx-reformat
+libcxx/include/type_traits merge=libcxx-reformat
+libcxx/include/typeindex merge=libcxx-reformat
+libcxx/include/typeinfo merge=libcxx-reformat
+libcxx/include/unordered_map merge=libcxx-reformat
+libcxx/include/unordered_set merge=libcxx-reformat
+libcxx/include/utility merge=libcxx-reformat
+libcxx/include/valarray merge=libcxx-reformat
+libcxx/include/variant merge=libcxx-reformat
+libcxx/include/vector merge=libcxx-reformat
+libcxx/include/version merge=libcxx-reformat
diff --git a/libcxx/include/__algorithm/binary_search.h b/libcxx/include/__algorithm/binary_search.h
index 5a1d49f5f43e2..7a77d7b5447bd 100644
--- a/libcxx/include/__algorithm/binary_search.h
+++ b/libcxx/include/__algorithm/binary_search.h
@@ -22,22 +22,16 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _ForwardIterator, class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-bool
-binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
-{
- __first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
- return __first != __last && !__comp(__value, *__first);
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) {
+ __first = std::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare> >(__first, __last, __value, __comp);
+ return __first != __last && !__comp(__value, *__first);
}
template <class _ForwardIterator, class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-bool
-binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
-{
- return std::binary_search(__first, __last, __value, __less<>());
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
+binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
+ return std::binary_search(__first, __last, __value, __less<>());
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h
index 2797e9da66585..15f4a535a30bf 100644
--- a/libcxx/include/__algorithm/comp_ref_type.h
+++ b/libcxx/include/__algorithm/comp_ref_type.h
@@ -20,52 +20,42 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Compare>
-struct __debug_less
-{
- _Compare &__comp_;
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI __debug_less(_Compare& __c) : __comp_(__c) {}
+struct __debug_less {
+ _Compare& __comp_;
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI __debug_less(_Compare& __c) : __comp_(__c) {}
- template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
- bool operator()(const _Tp& __x, const _Up& __y)
- {
- bool __r = __comp_(__x, __y);
- if (__r)
- __do_compare_assert(0, __y, __x);
- return __r;
- }
+ template <class _Tp, class _Up>
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(const _Tp& __x, const _Up& __y) {
+ bool __r = __comp_(__x, __y);
+ if (__r)
+ __do_compare_assert(0, __y, __x);
+ return __r;
+ }
- template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI
- bool operator()(_Tp& __x, _Up& __y)
- {
- bool __r = __comp_(__x, __y);
- if (__r)
- __do_compare_assert(0, __y, __x);
- return __r;
- }
+ template <class _Tp, class _Up>
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_HIDE_FROM_ABI bool operator()(_Tp& __x, _Up& __y) {
+ bool __r = __comp_(__x, __y);
+ if (__r)
+ __do_compare_assert(0, __y, __x);
+ return __r;
+ }
- template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_SINCE_CXX14
- inline _LIBCPP_HIDE_FROM_ABI
- decltype((void)std::declval<_Compare&>()(
- std::declval<_LHS &>(), std::declval<_RHS &>()))
- __do_compare_assert(int, _LHS & __l, _RHS & __r) {
- _LIBCPP_ASSERT_UNCATEGORIZED(!__comp_(__l, __r),
- "Comparator does not induce a strict weak ordering");
- (void)__l;
- (void)__r;
- }
+ template <class _LHS, class _RHS>
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(
+ std::declval<_LHS&>(), std::declval<_RHS&>()))
+ __do_compare_assert(int, _LHS& __l, _RHS& __r) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
+ (void)__l;
+ (void)__r;
+ }
- template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_SINCE_CXX14
- inline _LIBCPP_HIDE_FROM_ABI
- void __do_compare_assert(long, _LHS &, _RHS &) {}
+ template <class _LHS, class _RHS>
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI void __do_compare_assert(long, _LHS&, _RHS&) {}
};
// Pass the comparator by lvalue reference. Or in debug mode, using a
// debugging wrapper that stores a reference.
-# if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
+#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
template <class _Comp>
using __comp_ref_type = __debug_less<_Comp>;
#else
diff --git a/libcxx/include/__algorithm/copy_backward.h b/libcxx/include/__algorithm/copy_backward.h
index d85d297b3226c..3ec88d8bd5cc3 100644
--- a/libcxx/include/__algorithm/copy_backward.h
+++ b/libcxx/include/__algorithm/copy_backward.h
@@ -108,8 +108,7 @@ struct __copy_backward_loop {
struct __copy_backward_trivial {
// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.
- template <class _In, class _Out,
- __enable_if_t<__can_lower_copy_assignment_to_memmove<_In, _Out>::value, int> = 0>
+ 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_backward_trivial_impl(__first, __last, __result);
@@ -124,16 +123,13 @@ __copy_backward(_BidirectionalIterator1 __first, _Sentinel __last, _Bidirectiona
}
template <class _BidirectionalIterator1, class _BidirectionalIterator2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-_BidirectionalIterator2
-copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
- _BidirectionalIterator2 __result)
-{
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _BidirectionalIterator2
+copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) {
static_assert(std::is_copy_constructible<_BidirectionalIterator1>::value &&
- std::is_copy_constructible<_BidirectionalIterator1>::value, "Iterators must be copy constructible.");
+ std::is_copy_constructible<_BidirectionalIterator1>::value,
+ "Iterators must be copy constructible.");
- return std::__copy_backward<_ClassicAlgPolicy>(
- std::move(__first), std::move(__last), std::move(__result)).second;
+ return std::__copy_backward<_ClassicAlgPolicy>(std::move(__first), std::move(__last), std::move(__result)).second;
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/copy_if.h b/libcxx/include/__algorithm/copy_if.h
index d68d1dbbadf8a..228e4d22323e3 100644
--- a/libcxx/include/__algorithm/copy_if.h
+++ b/libcxx/include/__algorithm/copy_if.h
@@ -17,21 +17,16 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-_OutputIterator
-copy_if(_InputIterator __first, _InputIterator __last,
- _OutputIterator __result, _Predicate __pred)
-{
- for (; __first != __last; ++__first)
- {
- if (__pred(*__first))
- {
- *__result = *__first;
- ++__result;
- }
+template <class _InputIterator, class _OutputIterator, class _Predicate>
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
+copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) {
+ for (; __first != __last; ++__first) {
+ if (__pred(*__first)) {
+ *__result = *__first;
+ ++__result;
}
- return __result;
+ }
+ return __result;
}
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/copy_move_common.h b/libcxx/include/__algorithm/copy_move_common.h
index c06892e9e3c79..b350507e32bae 100644
--- a/libcxx/include/__algorithm/copy_move_common.h
+++ b/libcxx/include/__algorithm/copy_move_common.h
@@ -38,22 +38,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _From, class _To>
struct __can_lower_copy_assignment_to_memmove {
static const bool value =
- // If the types are always bitcastable, it's valid to do a bitwise copy between them.
- __is_always_bitcastable<_From, _To>::value &&
- // Reject conversions that wouldn't be performed by the regular built-in assignment (e.g. between arrays).
- is_trivially_assignable<_To&, const _From&>::value &&
- // `memmove` doesn't accept `volatile` pointers, make sure the optimization SFINAEs away in that case.
- !is_volatile<_From>::value &&
- !is_volatile<_To>::value;
+ // If the types are always bitcastable, it's valid to do a bitwise copy between them.
+ __is_always_bitcastable<_From, _To>::value &&
+ // Reject conversions that wouldn't be performed by the regular built-in assignment (e.g. between arrays).
+ is_trivially_assignable<_To&, const _From&>::value &&
+ // `memmove` doesn't accept `volatile` pointers, make sure the optimization SFINAEs away in that case.
+ !is_volatile<_From>::value && !is_volatile<_To>::value;
};
template <class _From, class _To>
struct __can_lower_move_assignment_to_memmove {
static const bool value =
- __is_always_bitcastable<_From, _To>::value &&
- is_trivially_assignable<_To&, _From&&>::value &&
- !is_volatile<_From>::value &&
- !is_volatile<_To>::value;
+ __is_always_bitcastable<_From, _To>::value && is_trivially_assignable<_To&, _From&&>::value &&
+ !is_volatile<_From>::value && !is_volatile<_To>::value;
};
// `memmove` algorithms implementation.
@@ -95,8 +92,8 @@ struct __can_rewrap<_InIter,
_Sent,
_OutIter,
// Note that sentinels are always copy-constructible.
- __enable_if_t< is_copy_constructible<_InIter>::value &&
- is_copy_constructible<_OutIter>::value > > : true_type {};
+ __enable_if_t< is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value > >
+ : true_type {};
template <class _Algorithm,
class _InIter,
@@ -108,7 +105,7 @@ __unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
auto __range = std::__unwrap_range(__first, std::move(__last));
auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),
- ...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/74334
More information about the libcxx-commits
mailing list