[libcxx-commits] [libcxx] [libc++][modules] Rewrite the modulemap to have fewer top-level modules (PR #107638)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 12 12:50:09 PDT 2024
================
@@ -1,2111 +1,1843 @@
-// Main C++ standard library interfaces
-module std_algorithm [system] {
- header "algorithm"
- export *
-}
-module std_any [system] {
- header "any"
- export *
-}
-module std_array [system] {
- header "array"
- export *
-}
-module std_atomic [system] {
- header "atomic"
- export *
-}
-module std_barrier [system] {
- header "barrier"
- export *
-}
-module std_bit [system] {
- header "bit"
- export *
-}
-module std_bitset [system] {
- header "bitset"
- export *
-}
-module std_charconv [system] {
- header "charconv"
- module chars_format { header "__charconv/chars_format.h" }
- module from_chars_integral { header "__charconv/from_chars_integral.h" }
- module from_chars_result { header "__charconv/from_chars_result.h" }
- module tables { header "__charconv/tables.h" }
- module to_chars { header "__charconv/to_chars.h" }
- module to_chars_base_10 { header "__charconv/to_chars_base_10.h" }
- module to_chars_floating_point { header "__charconv/to_chars_floating_point.h" }
- module to_chars_integral { header "__charconv/to_chars_integral.h" }
- module to_chars_result { header "__charconv/to_chars_result.h" }
- module traits { header "__charconv/traits.h" }
- export *
-}
-module std_chrono [system] {
- header "chrono"
- export *
-}
-module std_codecvt [system] {
- header "codecvt"
- export *
-}
-module std_compare [system] {
- header "compare"
- export *
-}
-module std_complex [system] {
- header "complex"
- export *
-}
-module std_concepts [system] {
- header "concepts"
- export *
-}
-module std_condition_variable [system] {
- header "condition_variable"
- module condition_variable { header "__condition_variable/condition_variable.h" }
- export *
-}
-module std_coroutine [system] {
- header "coroutine"
- module coroutine_handle { header "__coroutine/coroutine_handle.h" }
- module coroutine_traits { header "__coroutine/coroutine_traits.h" }
- module noop_coroutine_handle { header "__coroutine/noop_coroutine_handle.h" }
- module trivial_awaitables { header "__coroutine/trivial_awaitables.h" }
- export *
-}
-module std_deque [system] {
- header "deque"
- export *
-}
-module std_exception [system] {
- header "exception"
- export *
-}
-module std_execution [system] {
- header "execution"
- export *
-}
-module std_expected [system] {
- header "expected"
- export *
-}
-module std_filesystem [system] {
- header "filesystem"
- module copy_options { header "__filesystem/copy_options.h" }
- module directory_entry { header "__filesystem/directory_entry.h" }
- module directory_iterator { header "__filesystem/directory_iterator.h" }
- module directory_options { header "__filesystem/directory_options.h" }
- module file_status { header "__filesystem/file_status.h" }
- module file_time_type { header "__filesystem/file_time_type.h" }
- module file_type { header "__filesystem/file_type.h" }
- module filesystem_error {
- header "__filesystem/filesystem_error.h"
- export std_private_memory_shared_ptr
- }
- module operations { header "__filesystem/operations.h" }
- module path {
- header "__filesystem/path.h"
- export std_string // returned by various methods
- }
- module path_iterator { header "__filesystem/path_iterator.h" }
- module perm_options { header "__filesystem/perm_options.h" }
- module perms { header "__filesystem/perms.h" }
- module recursive_directory_iterator { header "__filesystem/recursive_directory_iterator.h" }
- module space_info { header "__filesystem/space_info.h" }
- module u8path { header "__filesystem/u8path.h" }
- export *
-}
-module std_format [system] {
- header "format"
- export *
-}
-module std_forward_list [system] {
- header "forward_list"
- export *
-}
-module std_fstream [system] {
- header "fstream"
- export *
-}
-module std_functional [system] {
- header "functional"
- export *
-}
-module std_future [system] {
- header "future"
- export *
-}
-module std_initializer_list [system] {
- header "initializer_list"
- export *
-}
-module std_iomanip [system] {
- header "iomanip"
- export *
-}
-module std_ios [system] {
- header "ios"
- export *
-}
-module std_iosfwd [system] {
- header "iosfwd"
- export *
-}
-module std_iostream [system] {
- header "iostream"
- export *
-}
-module std_istream [system] {
- header "istream"
- export *
-}
-module std_iterator [system] {
- header "iterator"
- export *
-}
-module std_latch [system] {
- header "latch"
- export *
-}
-module std_limits [system] {
- header "limits"
- export *
-}
-module std_list [system] {
- header "list"
- export *
-}
-module std_locale [system] {
- header "locale"
- export *
-}
-module std_map [system] {
- header "map"
+// This module contains headers related to the configuration of the library. These headers
+// are free of any dependency on the rest of libc++.
+module std_config [system] {
+ textual header "__config"
+ textual header "__configuration/abi.h"
+ textual header "__configuration/availability.h"
+ textual header "__configuration/compiler.h"
+ textual header "__configuration/language.h"
+ textual header "__configuration/platform.h"
+ textual header "version"
export *
}
-module std_mdspan [system] {
- header "mdspan"
- module default_accessor { header "__mdspan/default_accessor.h" }
- module extents { header "__mdspan/extents.h" }
- module fwd { header "__fwd/mdspan.h" }
- module layout_left { header "__mdspan/layout_left.h" }
- module layout_right { header "__mdspan/layout_right.h" }
- module layout_stride { header "__mdspan/layout_stride.h" }
- module mdspan {
- header "__mdspan/mdspan.h"
- export std_array // for strides()
+
+module std_core [system] {
+ module cstddef {
+ module byte { header "__cstddef/byte.h" }
+ module max_align_t { header "__cstddef/max_align_t.h" }
+ module nullptr_t { header "__cstddef/nullptr_t.h" }
+ module ptrdiff_t { header "__cstddef/ptrdiff_t.h" }
+ module size_t { header "__cstddef/size_t.h" }
+ export *
+ }
+
+ module cstdint {
+ header "cstdint"
+ export *
+ }
+
+ module fwd {
+ module byte { header "__fwd/byte.h" }
+ module functional { header "__fwd/functional.h" }
+ module pair { header "__fwd/pair.h" }
+ module tuple { header "__fwd/tuple.h" }
+ export *
+ }
+
+ module limits {
+ header "limits"
+ export *
+ }
+
+ module math {
+ module abs { header "__math/abs.h" }
+ module copysign { header "__math/copysign.h" }
+ module error_functions { header "__math/error_functions.h" }
+ module exponential_functions { header "__math/exponential_functions.h" }
+ module fdim { header "__math/fdim.h" }
+ module fma { header "__math/fma.h" }
+ module gamma { header "__math/gamma.h" }
+ module hyperbolic_functions { header "__math/hyperbolic_functions.h" }
+ module hypot { header "__math/hypot.h" }
+ module inverse_hyperbolic_functions { header "__math/inverse_hyperbolic_functions.h" }
+ module inverse_trigonometric_functions { header "__math/inverse_trigonometric_functions.h" }
+ module logarithms { header "__math/logarithms.h" }
+ module min_max { header "__math/min_max.h" }
+ module modulo { header "__math/modulo.h" }
+ module remainder { header "__math/remainder.h" }
+ module roots { header "__math/roots.h" }
+ module rounding_functions { header "__math/rounding_functions.h" }
+ module special_functions { header "__math/special_functions.h" }
+ module traits { header "__math/traits.h" }
+ module trigonometric_functions { header "__math/trigonometric_functions.h" }
+ export *
+ }
+
+ module type_traits {
+ module add_const { header "__type_traits/add_const.h" }
+ module add_cv { header "__type_traits/add_cv.h" }
+ module add_lvalue_reference { header "__type_traits/add_lvalue_reference.h" }
+ module add_pointer { header "__type_traits/add_pointer.h" }
+ module add_rvalue_reference { header "__type_traits/add_rvalue_reference.h" }
+ module add_volatile { header "__type_traits/add_volatile.h" }
+ module aligned_storage { header "__type_traits/aligned_storage.h" }
+ module aligned_union { header "__type_traits/aligned_union.h" }
+ module alignment_of { header "__type_traits/alignment_of.h" }
+ module can_extract_key { header "__type_traits/can_extract_key.h" }
+ module common_reference { header "__type_traits/common_reference.h" }
+ module common_type { header "__type_traits/common_type.h" }
+ module conditional { header "__type_traits/conditional.h" }
+ module conjunction { header "__type_traits/conjunction.h" }
+ module copy_cv { header "__type_traits/copy_cv.h" }
+ module copy_cvref { header "__type_traits/copy_cvref.h" }
+ module datasizeof { header "__type_traits/datasizeof.h" }
+ module decay { header "__type_traits/decay.h" }
+ module dependent_type { header "__type_traits/dependent_type.h" }
+ module desugars_to { header "__type_traits/desugars_to.h" }
+ module disjunction { header "__type_traits/disjunction.h" }
+ module enable_if { header "__type_traits/enable_if.h" }
+ module extent { header "__type_traits/extent.h" }
+ module has_unique_object_representation { header "__type_traits/has_unique_object_representation.h" }
+ module has_virtual_destructor { header "__type_traits/has_virtual_destructor.h" }
+ module integral_constant { header "__type_traits/integral_constant.h" }
+ module invoke { header "__type_traits/invoke.h" }
+ module is_abstract {
+ header "__type_traits/is_abstract.h"
+ export integral_constant
+ }
+ module is_aggregate {
+ header "__type_traits/is_aggregate.h"
+ export integral_constant
+ }
+ module is_allocator {
+ header "__type_traits/is_allocator.h"
+ export integral_constant
+ }
+ module is_always_bitcastable {
+ header "__type_traits/is_always_bitcastable.h"
+ export integral_constant
+ }
+ module is_arithmetic {
+ header "__type_traits/is_arithmetic.h"
+ export integral_constant
+ }
+ module is_array {
+ header "__type_traits/is_array.h"
+ export integral_constant
+ }
+ module is_assignable {
+ header "__type_traits/is_assignable.h"
+ export integral_constant
+ }
+ module is_base_of {
+ header "__type_traits/is_base_of.h"
+ export integral_constant
+ }
+ module is_bounded_array {
+ header "__type_traits/is_bounded_array.h"
+ export integral_constant
+ }
+ module is_callable {
+ header "__type_traits/is_callable.h"
+ export integral_constant
+ }
+ module is_char_like_type {
+ header "__type_traits/is_char_like_type.h"
+ export integral_constant
+ }
+ module is_class {
+ header "__type_traits/is_class.h"
+ export integral_constant
+ }
+ module is_compound {
+ header "__type_traits/is_compound.h"
+ export integral_constant
+ }
+ module is_const {
+ header "__type_traits/is_const.h"
+ export integral_constant
+ }
+ module is_constant_evaluated {
+ header "__type_traits/is_constant_evaluated.h"
+ export integral_constant
+ }
+ module is_constructible {
+ header "__type_traits/is_constructible.h"
+ export integral_constant
+ }
+ module is_convertible {
+ header "__type_traits/is_convertible.h"
+ export integral_constant
+ }
+ module is_core_convertible {
+ header "__type_traits/is_core_convertible.h"
+ export integral_constant
+ }
+ module is_destructible {
+ header "__type_traits/is_destructible.h"
+ export integral_constant
+ }
+ module is_empty {
+ header "__type_traits/is_empty.h"
+ export integral_constant
+ }
+ module is_enum {
+ header "__type_traits/is_enum.h"
+ export integral_constant
+ }
+ module is_equality_comparable {
+ header "__type_traits/is_equality_comparable.h"
+ export integral_constant
+ }
+ module is_execution_policy {
+ header "__type_traits/is_execution_policy.h"
+ export integral_constant
+ }
+ module is_final {
+ header "__type_traits/is_final.h"
+ export integral_constant
+ }
+ module is_floating_point {
+ header "__type_traits/is_floating_point.h"
+ export integral_constant
+ }
+ module is_function {
+ header "__type_traits/is_function.h"
+ export integral_constant
+ }
+ module is_fundamental {
+ header "__type_traits/is_fundamental.h"
+ export integral_constant
+ }
+ module is_implicitly_default_constructible {
+ header "__type_traits/is_implicitly_default_constructible.h"
+ export integral_constant
+ }
+ module is_integral {
+ header "__type_traits/is_integral.h"
+ export integral_constant
+ }
+ module is_literal_type {
+ header "__type_traits/is_literal_type.h"
+ export integral_constant
+ }
+ module is_member_pointer {
+ header "__type_traits/is_member_pointer.h"
+ export integral_constant
+ }
+ module is_nothrow_assignable {
+ header "__type_traits/is_nothrow_assignable.h"
+ export integral_constant
+ }
+ module is_nothrow_constructible {
+ header "__type_traits/is_nothrow_constructible.h"
+ export integral_constant
+ }
+ module is_nothrow_convertible {
+ header "__type_traits/is_nothrow_convertible.h"
+ export integral_constant
+ }
+ module is_nothrow_destructible {
+ header "__type_traits/is_nothrow_destructible.h"
+ export integral_constant
+ }
+ module is_null_pointer {
+ header "__type_traits/is_null_pointer.h"
+ export integral_constant
+ }
+ module is_object {
+ header "__type_traits/is_object.h"
+ export integral_constant
+ }
+ module is_pod {
+ header "__type_traits/is_pod.h"
+ export integral_constant
+ }
+ module is_pointer {
+ header "__type_traits/is_pointer.h"
+ export integral_constant
+ }
+ module is_polymorphic {
+ header "__type_traits/is_polymorphic.h"
+ export integral_constant
+ }
+ module is_primary_template {
+ header "__type_traits/is_primary_template.h"
+ export integral_constant
+ }
+ module is_reference_wrapper {
+ header "__type_traits/is_reference_wrapper.h"
+ export integral_constant
+ }
+ module is_reference {
+ header "__type_traits/is_reference.h"
+ export integral_constant
+ }
+ module is_referenceable {
+ header "__type_traits/is_referenceable.h"
+ export integral_constant
+ }
+ module is_same {
+ header "__type_traits/is_same.h"
+ export integral_constant
+ }
+ module is_scalar {
+ header "__type_traits/is_scalar.h"
+ export integral_constant
+ }
+ module is_signed_integer {
+ header "__type_traits/is_signed_integer.h"
+ export integral_constant
+ }
+ module is_signed {
+ header "__type_traits/is_signed.h"
+ export integral_constant
+ }
+ module is_specialization {
+ header "__type_traits/is_specialization.h"
+ export integral_constant
+ }
+ module is_standard_layout {
+ header "__type_traits/is_standard_layout.h"
+ export integral_constant
+ }
+ module is_swappable {
+ header "__type_traits/is_swappable.h"
+ export integral_constant
+ }
+ module is_trivial {
+ header "__type_traits/is_trivial.h"
+ export integral_constant
+ }
+ module is_trivially_assignable {
+ header "__type_traits/is_trivially_assignable.h"
+ export integral_constant
+ }
+ module is_trivially_constructible {
+ header "__type_traits/is_trivially_constructible.h"
+ export integral_constant
+ }
+ module is_trivially_copyable {
+ header "__type_traits/is_trivially_copyable.h"
+ export integral_constant
+ }
+ module is_trivially_destructible {
+ header "__type_traits/is_trivially_destructible.h"
+ export integral_constant
+ }
+ module is_trivially_lexicographically_comparable {
+ header "__type_traits/is_trivially_lexicographically_comparable.h"
+ export integral_constant
+ }
+ module is_trivially_relocatable {
+ header "__type_traits/is_trivially_relocatable.h"
+ export integral_constant
+ }
+ module is_unbounded_array {
+ header "__type_traits/is_unbounded_array.h"
+ export integral_constant
+ }
+ module is_union {
+ header "__type_traits/is_union.h"
+ export integral_constant
+ }
+ module is_unsigned_integer {
+ header "__type_traits/is_unsigned_integer.h"
+ export integral_constant
+ }
+ module is_unsigned {
+ header "__type_traits/is_unsigned.h"
+ export integral_constant
+ }
+ module is_valid_expansion {
+ header "__type_traits/is_valid_expansion.h"
+ export integral_constant
+ }
+ module is_void {
+ header "__type_traits/is_void.h"
+ export integral_constant
+ }
+ module is_volatile {
+ header "__type_traits/is_volatile.h"
+ export integral_constant
+ }
+ module lazy { header "__type_traits/lazy.h" }
+ module make_32_64_or_128_bit { header "__type_traits/make_32_64_or_128_bit.h" }
+ module make_const_lvalue_ref { header "__type_traits/make_const_lvalue_ref.h" }
+ module make_signed { header "__type_traits/make_signed.h" }
+ module make_unsigned { header "__type_traits/make_unsigned.h" }
+ module maybe_const { header "__type_traits/maybe_const.h" }
+ module nat { header "__type_traits/nat.h" }
+ module negation { header "__type_traits/negation.h" }
+ module promote { header "__type_traits/promote.h" }
+ module rank { header "__type_traits/rank.h" }
+ module remove_all_extents { header "__type_traits/remove_all_extents.h" }
+ module remove_const_ref { header "__type_traits/remove_const_ref.h" }
+ module remove_const { header "__type_traits/remove_const.h" }
+ module remove_cv { header "__type_traits/remove_cv.h" }
+ module remove_cvref { header "__type_traits/remove_cvref.h" }
+ module remove_extent { header "__type_traits/remove_extent.h" }
+ module remove_pointer { header "__type_traits/remove_pointer.h" }
+ module remove_reference { header "__type_traits/remove_reference.h" }
+ module remove_volatile { header "__type_traits/remove_volatile.h" }
+ module result_of { header "__type_traits/result_of.h" }
+ module strip_signature { header "__type_traits/strip_signature.h" }
+ module type_identity { header "__type_traits/type_identity.h" }
+ module type_list { header "__type_traits/type_list.h" }
+ module underlying_type { header "__type_traits/underlying_type.h" }
+ module unwrap_ref { header "__type_traits/unwrap_ref.h" }
+ module void_t { header "__type_traits/void_t.h" }
+
+ header "type_traits"
+ export *
+ } // module type_traits
+
+ // Only the truly dependency-free parts of __utility are here
+ module utility_core {
+ module declval { header "__utility/declval.h" }
+ module forward { header "__utility/forward.h" }
+ export *
}
- export *
-}
-module std_memory [system] {
- header "memory"
- export *
-}
-module std_memory_resource [system] {
- header "memory_resource"
- export *
-}
-module std_mutex [system] {
- header "mutex"
- export *
-}
-module std_new [system] {
- header "new"
- export *
-}
-module std_numbers [system] {
- header "numbers"
- export *
-}
-module std_numeric [system] {
- header "numeric"
- export *
-}
-module std_optional [system] {
- header "optional"
- export *
-}
-module std_ostream [system] {
- header "ostream"
- export *
-}
-module std_print [system] {
- header "print"
- export *
-}
-module std_queue [system] {
- header "queue"
- export *
-}
-module std_random [system] {
- header "random"
- export *
-}
-module std_ranges [system] {
- header "ranges"
- export *
-}
-module std_ratio [system] {
- header "ratio"
- export *
-}
-module std_regex [system] {
- header "regex"
- export *
-}
-module std_scoped_allocator [system] {
- header "scoped_allocator"
- export *
-}
-module std_semaphore [system] {
- header "semaphore"
- export *
-}
-module std_set [system] {
- header "set"
- export *
-}
-module std_shared_mutex [system] {
- header "shared_mutex"
- export std_version
-}
-module std_source_location [system] {
- header "source_location"
- export *
-}
-module std_span [system] {
- header "span"
- export std_private_ranges_enable_borrowed_range
- export std_version
- export std_private_span_span_fwd
-}
-module std_sstream [system] {
- header "sstream"
- export *
-}
-module std_stack [system] {
- header "stack"
- export *
-}
-module std_stdexcept [system] {
- header "stdexcept"
- export *
-}
-module std_stop_token [system] {
- header "stop_token"
- private header "__stop_token/atomic_unique_lock.h"
- private header "__stop_token/intrusive_list_view.h"
- private header "__stop_token/intrusive_shared_ptr.h"
- private header "__stop_token/stop_callback.h"
- private header "__stop_token/stop_source.h"
- private header "__stop_token/stop_state.h"
- private header "__stop_token/stop_token.h"
- export *
-}
-module std_streambuf [system] {
- header "streambuf"
- export *
-}
-module std_string [system] {
- header "string"
- export *
-}
-module std_string_view [system] {
- header "string_view"
- export *
-}
-module std_strstream [system] {
- header "strstream"
- export *
-}
-module std_syncstream [system] {
- header "syncstream"
- export *
-}
-module std_system_error [system] {
- header "system_error"
- export *
-}
-module std_thread [system] {
- header "thread"
- export *
-}
-module std_tuple [system] {
- header "tuple"
- export *
-}
-module std_type_traits [system] {
- header "type_traits"
- export *
-}
-module std_typeindex [system] {
- header "typeindex"
- export *
-}
-module std_typeinfo [system] {
- header "typeinfo"
- export *
-}
-module std_unordered_map [system] {
- header "unordered_map"
- export *
-}
-module std_unordered_set [system] {
- header "unordered_set"
- export *
-}
-module std_utility [system] {
- header "utility"
- export *
-}
-module std_valarray [system] {
- header "valarray"
- export *
-}
-module std_variant [system] {
- header "variant"
- export *
-}
-module std_vector [system] {
- header "vector"
- export *
-}
-module std_version [system] {
- header "version"
- export *
-}
-// C standard library interface wrappers
-module std_cassert [system] {
- // <cassert>'s use of NDEBUG requires textual inclusion.
- textual header "cassert"
-}
-module std_ccomplex [system] {
- header "ccomplex"
- export *
-}
-module std_cctype [system] {
- header "cctype"
- export *
-}
-module std_cerrno [system] {
- header "cerrno"
- export *
-}
-module std_cfenv [system] {
- header "cfenv"
- export *
-}
-module std_cfloat [system] {
- header "cfloat"
- export *
-}
-module std_cinttypes [system] {
- header "cinttypes"
- export *
-}
-module std_ciso646 [system] {
- header "ciso646"
- export *
-}
-module std_climits [system] {
- header "climits"
- export *
-}
-module std_clocale [system] {
- header "clocale"
- export *
-}
-module std_cmath [system] {
- header "cmath"
- export *
-}
-module std_csetjmp [system] {
- header "csetjmp"
- export *
-}
-module std_csignal [system] {
- header "csignal"
- export *
-}
-// FIXME: <cstdalign> is missing.
-module std_cstdarg [system] {
- header "cstdarg"
- export *
-}
-module std_cstdbool [system] {
- header "cstdbool"
- export *
-}
-module std_cstddef [system] {
- header "cstddef"
- module byte { header "__cstddef/byte.h" }
- module max_align_t { header "__cstddef/max_align_t.h" }
- module nullptr_t { header "__cstddef/nullptr_t.h" }
- module ptrdiff_t { header "__cstddef/ptrdiff_t.h" }
- module size_t { header "__cstddef/size_t.h" }
- export *
-}
-module std_cstdint [system] {
- header "cstdint"
- export *
-}
-module std_cstdio [system] {
- header "cstdio"
- export *
-}
-module std_cstdlib [system] {
- header "cstdlib"
- export *
-}
-module std_cstring [system] {
- header "cstring"
- export *
-}
-module std_ctgmath [system] {
- header "ctgmath"
- export *
-}
-module std_ctime [system] {
- header "ctime"
- export *
-}
-module std_cuchar [system] {
- header "cuchar"
- export *
-}
-module std_cwchar [system] {
- header "cwchar"
- export *
-}
-module std_cwctype [system] {
- header "cwctype"
export *
-}
+} // module std_core
+
+module std [system] {
+ module algorithm {
+ module adjacent_find { header "__algorithm/adjacent_find.h" }
----------------
ldionne wrote:
I think that would make sense. However, I would suggest tackling that as a follow-up. I finally got to the point where I am able to mostly succeed the test suite after putting everything in submodules (which broke a ton of stuff that was missing includes & more). The same kind of thing seems to be happening with `explicit` where it's a lot stricter than without `explicit`.
Since almost all the benefits of this change don't require using `explicit`, I'd like to move forward without `explicit` and I can tackle that as a follow-up change.
https://github.com/llvm/llvm-project/pull/107638
More information about the libcxx-commits
mailing list