[all-commits] [llvm/llvm-project] e37bbf: [libcxx][modules] protects users from relying on l...

Christopher Di Bella via All-commits all-commits at lists.llvm.org
Fri Jul 16 15:39:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e37bbfe59ccd4ea0da95c02e9f36172239f4f0c3
      https://github.com/llvm/llvm-project/commit/e37bbfe59ccd4ea0da95c02e9f36172239f4f0c3
  Author: Christopher Di Bella <cjdb at google.com>
  Date:   2021-07-16 (Fri, 16 Jul 2021)

  Changed paths:
    M libcxx/include/module.modulemap
    M libcxx/include/span
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/adjacent_find.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/all_of.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/any_of.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/binary_search.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/clamp.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/comp.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/comp_ref_type.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/copy_backward.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/copy_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/copy_n.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/count.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/count_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/equal.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/equal_range.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/fill.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/fill_n.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/find.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/find_end.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/find_first_of.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/find_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/find_if_not.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/for_each.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/for_each_n.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/generate.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/generate_n.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/half_positive.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/includes.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/inplace_merge.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_heap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_heap_until.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_partitioned.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_permutation.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_sorted.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/is_sorted_until.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/iter_swap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/lexicographical_compare.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/lower_bound.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/make_heap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/max.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/max_element.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/merge.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/min.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/min_element.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/minmax.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/minmax_element.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/mismatch.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/move.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/move_backward.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/next_permutation.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/none_of.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/nth_element.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/partial_sort.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/partial_sort_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/partition.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/partition_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/partition_point.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/pop_heap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/prev_permutation.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/push_heap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/remove.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/remove_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/remove_copy_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/remove_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/replace.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/replace_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/replace_copy_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/replace_if.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/reverse.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/reverse_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/rotate.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/rotate_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/sample.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/search.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/search_n.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/set_difference.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/set_intersection.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/set_symmetric_difference.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/set_union.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/shift_left.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/shift_right.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/shuffle.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/sift_down.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/sort.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/sort_heap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/stable_partition.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/stable_sort.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/swap_ranges.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/transform.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/unique.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/unique_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/unwrap_iter.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/algorithm/upper_bound.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/availability.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/bit_reference.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/bits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/errc.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/format/format_error.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/format/format_parse_context.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/function_like.h.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/binary_function.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/binary_negate.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/bind.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/bind_front.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/binder1st.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/binder2nd.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/default_searcher.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/function.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/hash.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/identity.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/invoke.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/is_transparent.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/mem_fn.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/mem_fun_ref.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/not_fn.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/operations.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/perfect_forward.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/pointer_to_binary_function.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/pointer_to_unary_function.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/ranges_operations.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/reference_wrapper.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/unary_function.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/unary_negate.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/unwrap_ref.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/functional/weak_result_type.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/access.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/advance.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/back_insert_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/concepts.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/data.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/default_sentinel.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/distance.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/empty.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/erase_if_container.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/front_insert_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/incrementable_traits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/insert_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/istream_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/istreambuf_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/iter_move.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/iter_swap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/iterator_traits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/move_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/next.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/ostream_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/ostreambuf_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/prev.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/projected.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/readable_traits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/reverse_access.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/reverse_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/size.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/iterator/wrap_iter.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/locale.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/addressof.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/allocation_guard.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/allocator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/allocator_arg_t.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/allocator_traits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/auto_ptr.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/compressed_pair.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/construct_at.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/pointer_safety.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/pointer_traits.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/raw_storage_iterator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/shared_ptr.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/temporary_buffer.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/uninitialized_algorithms.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/unique_ptr.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/memory/uses_allocator.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/mutex_base.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/node_handle.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/random/uniform_int_distribution.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/access.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/all.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/concepts.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/copyable_box.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/data.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/drop_view.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty_view.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_borrowed_range.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_view.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/ref_view.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/size.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/subrange.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/transform_view.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/ranges/view_interface.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/split_buffer.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/std_stream.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/string.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/tuple.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/__decay_copy.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/as_const.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/cmp.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/declval.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/exchange.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/forward.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/in_place.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/integer_sequence.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/move.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/pair.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/piecewise_construct.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/rel_ops.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/swap.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/utility/to_underlying.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/variant/monostate.module.verify.cpp
    M libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/types.h
    M libcxx/utils/CMakeLists.txt
    A libcxx/utils/generate_private_header_tests.py

  Log Message:
  -----------
  [libcxx][modules] protects users from relying on libc++ detail headers (1/n)

libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as `<__algorithm/find.h>` instead of
`<algorithm>`, and Hyrum's law suggests that users will eventually begin
to rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

This is the first of four patches. Patch #2 will solve the problem for
pre-processor `#include`s; patches #3 and #4 will solve the problem for
`<__tree>` and `<__hash_table>` (since I've never touched the test cases
that are failing for these two, I want to split them out into their own
commits to be extra careful). Patch #5 will concern itself with
`<__threading_support>`, which intersects with libcxxabi (which I know
even less about).

Differential Revision: https://reviews.llvm.org/D105932




More information about the All-commits mailing list