[all-commits] [llvm/llvm-project] 7fdca7: [libc++] Guard much of std::ranges under _LIBCPP_H...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Feb 15 12:17:05 PST 2022


  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 7fdca71be63aa2abad2bff099c6754938a2fe4fc
      https://github.com/llvm/llvm-project/commit/7fdca71be63aa2abad2bff099c6754938a2fe4fc
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M libcxx/include/__algorithm/in_in_out_result.h
    M libcxx/include/__algorithm/in_out_result.h
    M libcxx/include/__filesystem/directory_iterator.h
    M libcxx/include/__filesystem/recursive_directory_iterator.h
    M libcxx/include/__functional/ranges_operations.h
    M libcxx/include/__iterator/advance.h
    M libcxx/include/__iterator/distance.h
    M libcxx/include/__iterator/insert_iterator.h
    M libcxx/include/__iterator/iter_move.h
    M libcxx/include/__iterator/iter_swap.h
    M libcxx/include/__iterator/next.h
    M libcxx/include/__iterator/prev.h
    M libcxx/include/__memory/concepts.h
    M libcxx/include/__memory/ranges_construct_at.h
    M libcxx/include/__memory/ranges_uninitialized_algorithms.h
    M libcxx/include/__ranges/all.h
    M libcxx/include/__ranges/common_view.h
    M libcxx/include/__ranges/concepts.h
    M libcxx/include/__ranges/copyable_box.h
    M libcxx/include/__ranges/counted.h
    M libcxx/include/__ranges/dangling.h
    M libcxx/include/__ranges/data.h
    M libcxx/include/__ranges/drop_view.h
    M libcxx/include/__ranges/empty.h
    M libcxx/include/__ranges/empty_view.h
    M libcxx/include/__ranges/enable_borrowed_range.h
    M libcxx/include/__ranges/enable_view.h
    M libcxx/include/__ranges/iota_view.h
    M libcxx/include/__ranges/join_view.h
    M libcxx/include/__ranges/non_propagating_cache.h
    M libcxx/include/__ranges/owning_view.h
    M libcxx/include/__ranges/range_adaptor.h
    M libcxx/include/__ranges/ref_view.h
    M libcxx/include/__ranges/reverse_view.h
    M libcxx/include/__ranges/single_view.h
    M libcxx/include/__ranges/size.h
    M libcxx/include/__ranges/subrange.h
    M libcxx/include/__ranges/take_view.h
    M libcxx/include/__ranges/transform_view.h
    M libcxx/include/__ranges/view_interface.h
    M libcxx/include/ranges
    M libcxx/include/span
    M libcxx/include/string_view
    M libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp
    M libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_input_iterator.compile.pass.cpp
    M libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp
    A libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
    M libcxx/test/libcxx/ranges/range.access/end.incomplete_type.pass.cpp
    M libcxx/test/libcxx/ranges/range.utility.helpers/different_from.compile.pass.cpp
    M libcxx/test/libcxx/ranges/range.utility.helpers/has_arrow.compile.pass.cpp
    M libcxx/test/std/algorithms/algorithms.results/in_in_result.pass.cpp
    M libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/constraints.verify.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_count_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/lwg3664.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/constraints.compile.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/constraints.compile.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/iterator_count_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.nodiscard.verify.cpp
    M libcxx/test/std/iterators/predef.iterators/counted.iterator/compare.pass.cpp
    M libcxx/test/std/iterators/predef.iterators/iterators.common/assign.pass.cpp
    M libcxx/test/std/ranges/range.access/begin.pass.cpp
    M libcxx/test/std/ranges/range.access/end.pass.cpp
    M libcxx/test/std/ranges/range.req/range.range/borrowed_range.compile.pass.cpp
    M libcxx/test/std/ranges/range.req/range.range/borrowed_range.subsumption.compile.pass.cpp
    M libcxx/test/std/ranges/range.req/range.range/enable_borrowed_range.compile.pass.cpp
    M libcxx/test/std/strings/string.view/string.view.cons/from_iterator_sentinel.pass.cpp
    M libcxx/test/std/strings/string.view/string.view.deduct/range.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
    M libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp
    M libcxx/test/support/test_iterators.h
    M libcxx/test/support/test_macros.h

  Log Message:
  -----------
  [libc++] Guard much of std::ranges under _LIBCPP_HAS_NO_INCOMPLETE_RANGES.

The logic here is that we are disabling *only* things in `std::ranges::`.
Everything in `std::` is permitted, including `default_sentinel`, `contiguous_iterator`,
`common_iterator`, `projected`, `swappable`, and so on. Then, we include
anything from `std::ranges::` that is required in order to make those things
work: `ranges::swap`, `ranges::swap_ranges`, `input_range`, `ranges::begin`,
`ranges::iter_move`, and so on. But then that's all. Everything else (including
notably all of the "views" and the `std::views` namespace itself) is still
locked up behind `_LIBCPP_HAS_NO_INCOMPLETE_RANGES`.

Originally reviewed as https://reviews.llvm.org/D118736.

(cherry picked from commit 53406fb691db38b21decf233e091f648f8317b2d)

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


  Commit: 199e05e34bb8beb1cafce3a086932a32c493fa13
      https://github.com/llvm/llvm-project/commit/199e05e34bb8beb1cafce3a086932a32c493fa13
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp

  Log Message:
  -----------
  [libc++] Add missing UNSUPPORTED for the has-no-incomplete-ranges test

This wasn't caught because we don't test the combination of no-filesystem
and no-experimental-features in the CI.

(cherry picked from commit 7dad5f84f1b8a7aafd5a27ce2889bd72a1e54002)


  Commit: dfc24b8522ba9943e20bc4162d42d6b49bf85214
      https://github.com/llvm/llvm-project/commit/dfc24b8522ba9943e20bc4162d42d6b49bf85214
  Author: Konstantin Varlamov <varconst at apple.com>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M libcxx/cmake/caches/Generic-asan.cmake

  Log Message:
  -----------
  [libc++][NFC] Work around false positive ODR violations from ASan.

This works around a known issue in ASan. ASan doesn't instrument weak
symbols. Because instrumentation increases object size, the binary can
end up with two versions of the same object, one instrumented and one
not instrumented, with different sizes, which ASan will report as an ODR
violation. In libc++, this affects typeinfo for `std::bad_function_call`
which is emitted as a weak symbol in the test executable and as a strong
symbol in the shared library.

The main open issue for ASan appears to be
https://github.com/google/sanitizers/issues/1017.

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

(cherry picked from commit 10953974ed6b61247fd4b070b3a6e390e02d0edb)


Compare: https://github.com/llvm/llvm-project/compare/e493f08f8222...dfc24b8522ba


More information about the All-commits mailing list