[libcxx-commits] [PATCH] D153211: [libc++][Modules] Make module exports consistent with header includes

Ian Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 17 18:55:12 PDT 2023


iana created this revision.
iana added reviewers: ldionne, Mordante, philnik, Bigcheese.
Herald added subscribers: ributzka, arichardson.
Herald added a project: All.
iana requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Some modules export modules that they don't import (i.e. that their header doesn't directly include). That sometimes works when the exported submodule is in the same module, but when the `std` mega module is broken up (D144322 <https://reviews.llvm.org/D144322>), some of the exports stop working. Make the exports and includes consistent, mostly by adding includes for the exports. (It's not perfectly clear that this is the best way to solve the problem, but at least the unit tests are relying on several of the exports to keep working, it's the non-change in modules mode, and the least likely to break clients. Almost all of the added includes were transitively included already, so this is a small change in non-modules mode as well.)

__functional/invoke.h currently only includes __type_traits/invoke.h and not all of type_traits. Keep it using the specific header, and update its export. Similarly, __type_traits/underlying_type.h currently only includes __type_traits/is_enum.h, so update its export as well. This requires adding lots of export statements to the module map to keep the transitive includes working. Adding direct includes to the headers fixes check-cxx, but leaves many `run-buildbot generic-modules` tests failing, some even with linker errors.

__iterator/readable_traits.h can't include __iterator/iterator_traits.h because that makes an include cycle between the two headers. Make __iterator/readable_traits.h a textual header, and only include it from __iterator/iterator_traits.h.

<span> is listed in both and `std.span` and `std.experimental.span`. Delete the latter module.
There is no `__errc` module or header, so remove that export from `std.system_error`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153211

Files:
  libcxx/include/__algorithm/iterator_operations.h
  libcxx/include/__algorithm/ranges_partial_sort.h
  libcxx/include/__algorithm/ranges_partial_sort_copy.h
  libcxx/include/__algorithm/ranges_unique_copy.h
  libcxx/include/__chrono/high_resolution_clock.h
  libcxx/include/__filesystem/path.h
  libcxx/include/__format/format_context.h
  libcxx/include/__format/format_functions.h
  libcxx/include/__format/format_string.h
  libcxx/include/__format/formatter_output.h
  libcxx/include/__format/parser_std_format_spec.h
  libcxx/include/__format/unicode.h
  libcxx/include/__iterator/common_iterator.h
  libcxx/include/__iterator/concepts.h
  libcxx/include/__iterator/counted_iterator.h
  libcxx/include/__iterator/iter_swap.h
  libcxx/include/__iterator/iterator_with_data.h
  libcxx/include/__iterator/move_iterator.h
  libcxx/include/__iterator/reverse_iterator.h
  libcxx/include/__memory/concepts.h
  libcxx/include/__memory/ranges_construct_at.h
  libcxx/include/__memory/ranges_uninitialized_algorithms.h
  libcxx/include/__ranges/access.h
  libcxx/include/__ranges/all.h
  libcxx/include/__ranges/concepts.h
  libcxx/include/__ranges/rbegin.h
  libcxx/include/__ranges/rend.h
  libcxx/include/__ranges/transform_view.h
  libcxx/include/__system_error/error_condition.h
  libcxx/include/cwchar
  libcxx/include/iterator
  libcxx/include/mdspan
  libcxx/include/module.modulemap.in
  libcxx/include/string_view
  libcxx/include/tgmath.h
  libcxx/test/libcxx/algorithms/pstl.robust_against_customization_points_not_working.pass.cpp
  libcxx/test/libcxx/transitive_includes/cxx03.csv
  libcxx/test/libcxx/transitive_includes/cxx11.csv
  libcxx/test/libcxx/transitive_includes/cxx14.csv
  libcxx/test/libcxx/transitive_includes/cxx17.csv
  libcxx/test/libcxx/transitive_includes/cxx20.csv
  libcxx/test/libcxx/transitive_includes/cxx23.csv
  libcxx/test/libcxx/transitive_includes/cxx26.csv
  libcxx/utils/find_transitive_includes.py
  libcxx/utils/libcxx/test/header_information.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153211.532438.patch
Type: text/x-patch
Size: 66688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230618/df91cba4/attachment-0001.bin>


More information about the libcxx-commits mailing list