diff --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst --- a/libcxx/docs/Contributing.rst +++ b/libcxx/docs/Contributing.rst @@ -37,10 +37,11 @@ - Did you mark all functions and type declarations with the :ref:`proper visibility macro `? - If you added a header: - - Did you add it to ``include/module.modulemap.in``? - Did you add it to ``include/CMakeLists.txt``? - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated. - If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``? + - If it's a public header, did you add it to ``include/module.modulemap.in``? + - If it's a private header, does it need special clang module attributes in include/private_header_module_attributes.json.in? - Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it? - Did you run the ``libcxx-generate-files`` target and verify its output? diff --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst --- a/libcxx/docs/ReleaseNotes.rst +++ b/libcxx/docs/ReleaseNotes.rst @@ -80,6 +80,8 @@ - The headers ```` and ```` have been removed, since all the contents have been implemented in namespace ``std`` for at least two releases. +- The ``std`` clang module has been broken up into separate top level modules per public header. + - The formatter specialization ``template struct formatter`` has been removed. Since libc++'s format library was marked experimental there is no backwards compatibility option. This specialization has been removed diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -972,10 +972,8 @@ endforeach() configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY) -configure_file("module.modulemap.in" "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap" @ONLY) -set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" - "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap") +set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site") foreach(f ${files}) set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}") set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}") @@ -986,6 +984,50 @@ list(APPEND _all_includes "${dst}") endforeach() +check_cxx_compiler_flag(-cxx-isystem CXX_SUPPORTS_CXX_ISYSTEM_FLAG) +check_cxx_compiler_flag(-fshow-skipped-includes CXX_SUPPORTS_FSHOW_SKIPPED_INCLUDES_FLAG) +if (CXX_SUPPORTS_CXX_ISYSTEM_FLAG AND CXX_SUPPORTS_FSHOW_SKIPPED_INCLUDES_FLAG AND CXX_SUPPORTS_NOSTDINCXX_FLAG) + set(LIBCXX_INTERMEDIATES_DIR "${LLVM_BINARY_DIR}/intermediates") + configure_file(module.modulemap.in "${LIBCXX_INTERMEDIATES_DIR}/module.modulemap" @ONLY) + configure_file(private_header_module_attributes.json.in "${LIBCXX_INTERMEDIATES_DIR}/private_header_module_attributes.json" @ONLY) + + if (LIBCXX_GENERATED_INCLUDE_DIR STREQUAL LIBCXX_GENERATED_INCLUDE_TARGET_DIR) + set(libcxx_include_target_directory "") + else() + set(libcxx_include_target_directory --libcxx-include-target-directory ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}) + endif() + + if (DEFINED CMAKE_CXX_COMPILER_TARGET) + set(compiler_target --target ${CMAKE_CXX_COMPILER_TARGET}) + elseif (DEFINED LLVM_DEFAULT_TARGET_TRIPLE) + set(compiler_target --target ${LLVM_DEFAULT_TARGET_TRIPLE}) + else() + set(compiler_target "") + endif() + + if (DEFINED CMAKE_OSX_SYSROOT) + set(isysroot --isysroot ${CMAKE_OSX_SYSROOT}) + else() + set(isysroot "") + endif() + + add_custom_command(OUTPUT "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generate_module_map.py" + "${LIBCXX_INTERMEDIATES_DIR}/module.modulemap" + "${LIBCXX_INTERMEDIATES_DIR}/private_header_module_attributes.json" + ${_all_includes} + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/generate_module_map.py" + --libcxx-include-directory "${LIBCXX_GENERATED_INCLUDE_DIR}" + "${libcxx_include_target_directory}" + --intermediates-directory "${LIBCXX_INTERMEDIATES_DIR}" + --cxx-compiler "${CMAKE_CXX_COMPILER}" + ${compiler_target} + ${isysroot} + COMMENT "Generating clang module map module.modulemap") + + list(APPEND _all_includes "${LIBCXX_GENERATED_INCLUDE_DIR}/module.modulemap") +endif() + add_custom_target(generate-cxx-headers ALL DEPENDS ${_all_includes}) add_library(cxx-headers INTERFACE) diff --git a/libcxx/include/__algorithm/pstl_any_all_none_of.h b/libcxx/include/__algorithm/pstl_any_all_none_of.h --- a/libcxx/include/__algorithm/pstl_any_all_none_of.h +++ b/libcxx/include/__algorithm/pstl_any_all_none_of.h @@ -9,6 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H #define _LIBCPP___ALGORITHM_PSTL_ANY_ALL_NONE_OF_H +#include <__algorithm/move.h> +#include <__algorithm/pstl_backend.h> #include <__algorithm/pstl_find.h> #include <__algorithm/pstl_frontend_dispatch.h> #include <__config> @@ -16,6 +18,7 @@ #include <__type_traits/enable_if.h> #include <__type_traits/is_execution_policy.h> #include <__type_traits/remove_cvref.h> +#include <__utility/forward.h> #include <__utility/terminate_on_exception.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/pstl_fill.h b/libcxx/include/__algorithm/pstl_fill.h --- a/libcxx/include/__algorithm/pstl_fill.h +++ b/libcxx/include/__algorithm/pstl_fill.h @@ -10,12 +10,16 @@ #define _LIBCPP___ALGORITHM_PSTL_FILL_H #include <__algorithm/fill_n.h> +#include <__algorithm/move.h> +#include <__algorithm/pstl_backend.h> #include <__algorithm/pstl_for_each.h> #include <__algorithm/pstl_frontend_dispatch.h> #include <__config> #include <__iterator/iterator_traits.h> +#include <__type_traits/enable_if.h> #include <__type_traits/is_execution_policy.h> #include <__type_traits/remove_cvref.h> +#include <__utility/forward.h> #include <__utility/terminate_on_exception.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/pstl_find.h b/libcxx/include/__algorithm/pstl_find.h --- a/libcxx/include/__algorithm/pstl_find.h +++ b/libcxx/include/__algorithm/pstl_find.h @@ -11,12 +11,15 @@ #include <__algorithm/comp.h> #include <__algorithm/find.h> +#include <__algorithm/move.h> #include <__algorithm/pstl_backend.h> #include <__algorithm/pstl_frontend_dispatch.h> #include <__config> #include <__iterator/iterator_traits.h> +#include <__type_traits/enable_if.h> #include <__type_traits/is_execution_policy.h> #include <__type_traits/remove_cvref.h> +#include <__utility/forward.h> #include <__utility/terminate_on_exception.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/pstl_for_each.h b/libcxx/include/__algorithm/pstl_for_each.h --- a/libcxx/include/__algorithm/pstl_for_each.h +++ b/libcxx/include/__algorithm/pstl_for_each.h @@ -11,13 +11,16 @@ #include <__algorithm/for_each.h> #include <__algorithm/for_each_n.h> +#include <__algorithm/move.h> #include <__algorithm/pstl_backend.h> #include <__algorithm/pstl_frontend_dispatch.h> #include <__config> #include <__iterator/iterator_traits.h> +#include <__type_traits/enable_if.h> #include <__type_traits/is_execution_policy.h> #include <__type_traits/remove_cvref.h> #include <__type_traits/void_t.h> +#include <__utility/forward.h> #include <__utility/terminate_on_exception.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/pstl_transform.h b/libcxx/include/__algorithm/pstl_transform.h --- a/libcxx/include/__algorithm/pstl_transform.h +++ b/libcxx/include/__algorithm/pstl_transform.h @@ -13,6 +13,7 @@ #include <__config> #include <__iterator/iterator_traits.h> #include <__type_traits/is_execution_policy.h> +#include <__type_traits/remove_cvref.h> #include <__utility/terminate_on_exception.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -13,6 +13,7 @@ #include <__algorithm/comp_ref_type.h> #include <__algorithm/iter_swap.h> #include <__algorithm/iterator_operations.h> +#include <__algorithm/make_projected.h> #include <__algorithm/min_element.h> #include <__algorithm/partial_sort.h> #include <__algorithm/unwrap_iter.h> diff --git a/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h b/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h --- a/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h +++ b/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h @@ -13,6 +13,7 @@ #ifndef _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H #define _LIBCPP___LOCALE_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H +#include <__locale> #include <__locale_dir/locale_base_api/locale_guard.h> #include #include diff --git a/libcxx/include/__random/discrete_distribution.h b/libcxx/include/__random/discrete_distribution.h --- a/libcxx/include/__random/discrete_distribution.h +++ b/libcxx/include/__random/discrete_distribution.h @@ -11,9 +11,11 @@ #include <__algorithm/upper_bound.h> #include <__config> +#include <__iterator/wrap_iter.h> #include <__random/is_valid.h> #include <__random/uniform_real_distribution.h> #include +#include #include #include #include diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support --- a/libcxx/include/__threading_support +++ b/libcxx/include/__threading_support @@ -34,6 +34,13 @@ #elif !defined(_LIBCPP_HAS_NO_THREADS) #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD) +// Some platforms require in order for +// PTHREAD_COND_INITIALIZER to be expanded. Normally that would come +// in via , but it's a non-modular header on those platforms, +// so libc++'s usually absorbs atomic_wide_counter.h into the +// module with and makes atomic_wide_counter.h invisible. +// Include here to work around that. +# include # include # include #elif defined(_LIBCPP_HAS_THREAD_API_C11) diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd --- a/libcxx/include/experimental/simd +++ b/libcxx/include/experimental/simd @@ -652,6 +652,10 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__functional/operations.h> +#include <__type_traits/is_unsigned.h> +#include <__type_traits/is_volatile.h> +#include <__type_traits/remove_const.h> +#include <__utility/declval.h> #include #include #include diff --git a/libcxx/include/experimental/type_traits b/libcxx/include/experimental/type_traits --- a/libcxx/include/experimental/type_traits +++ b/libcxx/include/experimental/type_traits @@ -73,6 +73,7 @@ #if _LIBCPP_STD_VER >= 14 +#include <__type_traits/nat.h> #include #include diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -379,9 +379,11 @@ #include <__system_error/error_category.h> #include <__system_error/error_code.h> #include <__system_error/error_condition.h> +#include <__type_traits/add_lvalue_reference.h> #include <__type_traits/aligned_storage.h> #include <__type_traits/alignment_of.h> #include <__type_traits/strip_signature.h> +#include <__type_traits/underlying_type.h> #include <__utility/auto_cast.h> #include <__utility/forward.h> #include <__utility/move.h> diff --git a/libcxx/include/generate_module_map.py b/libcxx/include/generate_module_map.py new file mode 100644 --- /dev/null +++ b/libcxx/include/generate_module_map.py @@ -0,0 +1,637 @@ +#===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===----------------------------------------------------------------------===## + +import argparse +import json +import operator +import os +import re +import subprocess +import typing + +# The private libc++ detail headers are interdependent such that putting all +# of the e.g. __algorithm/*.h headers in a single module will result in module +# cycles with other libc++ modules. This script figures out how to group the +# private headers in the minimum number of modules per directory using the +# following system. +# 1. Run the preprocessor to get the includes of every libc++ header. +# 2. Build an include tree from the preprocessor output. +# 3. For each private header, collect the list of headers that transitively +# include it, and it transitively includes. +# 4. Convert the private headers and their transitive includes into modules. +# 5 Merge modules that are in the same directory and don't create a module +# cycle. Modules can be merged if the includers of each module are not in +# the includees of the other module. In other words, if they're at the same +# level of the module tree. +def main() -> None: + parser = argparse.ArgumentParser() + parser.add_argument('--libcxx-include-directory', required=True) + parser.add_argument('--libcxx-include-target-directory') + parser.add_argument('--intermediates-directory', required=True) + parser.add_argument('--cxx-compiler', required=True) + parser.add_argument('--target') + parser.add_argument('--isysroot') + args = parser.parse_args() + + libcxx_includes_path = os.path.join(args.intermediates_directory, 'libcxx_includes.cpp') + with open(libcxx_includes_path, 'w') as libcxx_includes_file: + write_libcxx_includes(args.libcxx_include_directory, libcxx_includes_file) + with open(os.path.join(args.intermediates_directory, 'private_header_module_attributes.json')) as module_attributes_file: + header_module_attributes = json.load(module_attributes_file) + include_tree = build_include_tree(args.cxx_compiler, args.target, args.isysroot, args.libcxx_include_directory, args.libcxx_include_target_directory, libcxx_includes_path, header_module_attributes) + private_headers_by_directory = collect_transitive_includes(include_tree) + modules_by_directory = build_modules(private_headers_by_directory) + write_module_map(modules_by_directory, args.libcxx_include_directory, args.intermediates_directory, header_module_attributes) + sanity_check_module_map(args.libcxx_include_directory, include_tree) + +def write_libcxx_includes(libcxx_include_directory: str, libcxx_includes_file: typing.TextIO) -> None: + for directory, subdirectorynames, filenames in os.walk(libcxx_include_directory): + if directory == libcxx_include_directory: + include_root = '' + # The ext, and __support headers are not included in the module. Not all of + # the __pstl headers compile, so exclude that directory too, even though some + # of the headers will be pulled in transitively and modularized. + subdirectorynames.remove('ext') + subdirectorynames.remove('__pstl') + subdirectorynames.remove('__support') + else: + include_root = os.path.relpath(directory, libcxx_include_directory) + + subdirectorynames.sort() + for filename in sorted(filenames): + # The __pstl headers are not included in the module. + if (directory == libcxx_include_directory) and filename.startswith('__pstl_'): + continue + + extension = os.path.splitext(filename)[1] + if (not extension) or (extension == '.h') or (extension == '.hh') or (extension == '.hp') or (extension == '.hpp') or (extension == '.hxx') or (extension == '.h++') or (extension == '.ipp'): + # Only extension-less and .h headers should be present, but allow for any C++ header file. + libcxx_includes_file.write('#include <') + libcxx_includes_file.write(os.path.join(include_root, filename)) + libcxx_includes_file.write('>\n') + +def build_include_tree(cxx_compiler: str, target: typing.Optional[str], isysroot: typing.Optional[str], libcxx_include_directory: str, libcxx_include_target_directory: typing.Optional[str], libcxx_includes_path: str, header_module_attributes: dict[str, 'ModuleAttributes']) -> typing.Iterable['Header']: + headers = {} # header objects keyed by path + # includes vary by standard, so all standards need to be run, and the includes unioned. + for standard in ['c++98', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b']: + cxx_command = [cxx_compiler] + if target: + cxx_command += ['-target', target] + if isysroot: + cxx_command += ['-isysroot', isysroot] + cxx_command += ['-E', '-H', '-fshow-skipped-includes'] + cxx_command.append('-std=' + standard) + cxx_command.append('-D_LIBCPP_ENABLE_EXPERIMENTAL') + if standard != 'c++98': + cxx_command.append('-D_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY') + cxx_command.append('-nostdinc++') + cxx_command += ['-cxx-isystem', libcxx_include_directory] + if libcxx_include_target_directory: + cxx_command += ['-cxx-isystem', libcxx_include_target_directory] + cxx_command.append('-w') + cxx_command.append(libcxx_includes_path) + + includes = subprocess.run(cxx_command, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, check=True, text=True).stderr + + # Consider 'a' that includes 'b' and 'c', 'b' that includes 'c', and 'c' that includes + # nothing. All three headers have header guards. For an input file that includes all three, + # -H -fshow-skipped-includes will look like this. + # . /a + # .. /b + # ... /c + # .. /c + # . /b + # . /c + # The last three lines are skipped includes - a's include of c is skipped because c has already + # been seen via b, and same with the input file's includes of b and c that have already been seen + # via a and b. Skipped includes do not re-list any of their includes, which is why there isn't a + # ".. /c" under ". /b". The first time a header is seen, it will show all of its direct includes + # and potentially some of its transitive includes. Headers without header guards are not skipped, + # and can have different includes depending on the context. + header_stack = [] # list of tuples (level, path) + for line in includes.splitlines(): + if not line.startswith('.'): + continue + + dots, include = line.split(' ', maxsplit=1) + level = len(dots) + current_header = headers.setdefault(include, Header(include, libcxx_include_directory, header_module_attributes)) + + while header_stack and (level <= header_stack[-1][0]): + del header_stack[-1] + + if header_stack: + parent_header = header_stack[-1][1] + parent_header.included_headers.add(current_header) + current_header.including_headers.add(parent_header) + + header_stack.append((level, current_header)) + return headers.values() + +def collect_transitive_includes(include_tree: typing.Iterable['Header']) -> dict[str, list['Header']]: + def collect_transitive_includes_for_header(header: 'Header', include_attribute: str, transitive_include_attribute: str, should_detect_cycles: bool) -> set[tuple['Header']]: + transitive_includes = getattr(header, transitive_include_attribute) + + # includes_to_follow is a list of sets of headers. It starts out as the + # includes from the header being analyzed. One of the includes is taken + # from the last set, and its includes are added to the end of the list. + # Another include is selected from the new last set, and so on until the + # include path hits the end, or a cycle is detected. After that, the + # include path removes its last include, and a sibling include from the + # last set is selected. When there are no more siblings, the include path + # goes up a level until eventually there are no more includes to process. + includes = getattr(header, include_attribute) + includes_to_follow = [includes.copy()] if includes else [] + include_path = [header] + + seen_headers = {header} + cycles = set() + while includes_to_follow: + selected_header = includes_to_follow[-1].pop() + transitive_includes.add(selected_header) + + include_path.append(selected_header) + selected_header_includes = getattr(selected_header, include_attribute) + + if should_detect_cycles: + cycles |= detect_cycles(include_path, selected_header_includes) + + selected_header_includes_to_follow = selected_header_includes - seen_headers + if selected_header_includes_to_follow: + includes_to_follow.append(selected_header_includes_to_follow) + else: + # Hit the end of the include path, peel back a level. + del include_path[-1] + + # Peel back the completed levels. + while includes_to_follow and not includes_to_follow[-1]: + del includes_to_follow[-1] + del include_path[-1] + + seen_headers.add(selected_header) + + return cycles + + private_headers_by_directory = {} + cycles = set() + for header in include_tree: + if not header.is_private_libcxx_header: + continue + + # The same cycles should be returned as the graph is traversed up and down. Just collect them + # from the included headers since that's the more intuitive direction ("a includes b includes c + # includes a" rather than "c is included by b is included by a is included by c"). + collect_transitive_includes_for_header(header, 'including_headers', 'transitive_including_headers', should_detect_cycles = False) + cycles |= collect_transitive_includes_for_header(header, 'included_headers', 'transitive_included_headers', should_detect_cycles = True) + private_headers_by_directory.setdefault(header.module_directory, []).append(header) + + if cycles: + print('Include cycles detected across libc++ modules, these must be broken before modules can be made for the libc++ private headers\n') + for cycle in sorted(cycles): + for header in cycle: + print(header.path) + print() + exit(1) + + return private_headers_by_directory + +def detect_cycles(include_path: list['Header'], next_includes: set['Header']) -> set[tuple['Header']]: + cycles = set() + for index, include_header in enumerate(include_path): + if include_header in next_includes: + # Include cycles are only a problem if they cross module boundaries. + # If the cycle just consists of non-libc++ headers, then presumably + # those are all in the same module and it's fine. + # + # If only one libc++ header is involved, then it's unclear if the + # cycle needs to be broken in libc++ or externally. Don't report + # that cycle either, if the non-libc++ headers are in a + # [no_undeclared_includes] module, then that will break the cycle. + # Otherwise, the module cycle should be caught in the modules_include + # unit test and a strategy can be devised from there. + # + # A cycle involving only private headers in the same directory isn't + # technically a problem if those headers could be grouped into the + # same module. However, figuring out if the headers can be grouped is + # tricky at this point, and there aren't currently any such cycles. + # For now, don't allow that situation. + cycle_header_crosses_module_boundary = True + libcxx_header_count = 0 + cycle = include_path[index:] + for cycle_header in cycle: + if not cycle_header_crosses_module_boundary: + cycle_header_crosses_module_boundary = cycle_header in extra_modular_libcxx_headers + if cycle_header.is_libxx_header: + libcxx_header_count += 1 + + if cycle_header_crosses_module_boundary and (libcxx_header_count >= 2): + # The include cycle could potentially be entered at any point and + # thus get double reported, i.e. as a -> b -> a and b -> a -> b. + # Rotate the cycle so that the smallest item is at the end points. + # For the above cycle, assume that include_path = cycle = [b, a] + # and b is in next_includes. Report (a, b, a) as the cycle by + # starting at a and going to the end, then going from the start + # back to and including a. + starting_point = cycle.index(min(cycle)) + cycles.add((*cycle[starting_point:], *cycle[:(starting_point + 1)])) + break + return cycles + +def build_modules(private_headers_by_directory: dict[str, list['Header']]) -> dict[str, 'Module']: + # Build the initial set of modules. + modules_by_directory, all_modules = group_headers_into_modules(private_headers_by_directory) + + # The modules essentially constitute a module tree parallel to the include tree*. Enumerate + # the modules and merge them where it doesn't create a cycle. Module a and b can be merged + # if none of b's including modules are included by a, and if none of a's including modules + # are included by b. Multiple passes are required, consider a -> c -> b. On the first pass, + # a and b can't be merged because that would make a cycle ab -> c -> ab. However a and c + # can be merged: ac -> b. On the second pass, ac can merge with b. Keep looping until no + # more merges can be made. + # + # * "essentially" because only the private libc++ headers are put into modules, the remaining + # headers stay as headers and are optimistically treated like modules. The libc++ public headers + # are each in their own standalone module, except for the experimental headers which are all + # together in a single module. It's assumed that the experimental module sits strictly on top + # of all of the other libc++ modules. That is, nothing includes experimental headers except other + # experimental headers, they'll never show up in any module's included headers, and so they won't + # effectively matter for grouping. The non-libc++ headers are optimistically assumed to be in + # individual modules. If that isn't the case, then it's possible that they can cause module cycles. + # The modules_include unit test will catch those, and if there are any then a strategy can be + # found to solve the cycle. + did_merge = True + while did_merge: + did_merge, modules_by_directory = merge_modules(modules_by_directory, all_modules) + + # The module lists in modules_for_directory are sorted so that the headers roughly come out in + # alphabetical order. If headers are grouped into modules acf, be, d, then the modules will be + # in that order, except reversed for ease of list enumeration. Reverse the lists so that they're + # in the right order before returning them. The headers in each module are unsorted, e.g. the + # first module might actually be afc, sort those so that they're in the right order too. + for directory, modules_for_directory in modules_by_directory.items(): + for module in modules_for_directory: + module.headers.sort(key=operator.attrgetter('submodule_name')) + modules_for_directory.reverse() + return modules_by_directory + +def group_headers_into_modules(private_headers_by_directory: dict[str, list['Header']]) -> tuple[dict[str, 'Module'], list['Module']]: + # Headers are safe to group if their including and included headers match, modulo each other. + # In other words, if a and b's transitive includes match except that a includes b and b is + # included by a, then they can be grouped. It's tempting to try to more aggressively group + # headers that look like they're at the same level in the include tree, however that can + # create module cycles. e.g. a1 -> b1, b2 -> a2. None of a2's including headers are included + # by a1 and vice versa, and same with b2 and b1. However, if the a's and b's are both grouped + # into modules, then a1a2 -> b1b2 -> a1a2 and it's a module cycle. Start simple with the + # initial modules and only do the failsafe grouping. + def has_differing_transitive_includes(module: 'Module', header: 'Header', include_attribute: str) -> bool: + differing_transitive_includes = getattr(module, include_attribute) ^ getattr(header, include_attribute) + differing_transitive_includes.discard(header) + differing_transitive_includes.difference_update(module.headers) + return bool(differing_transitive_includes) + + modules = [] + modules_by_directory = {} + modules_by_header = {} + for directory, headers in private_headers_by_directory.items(): + # Visit the headers in alphabetical order. Reverse the headers and then enumerate + # them in reverse so that the consumed headers can be removed while enumerating. + sorted_headers = sorted(headers, key=operator.attrgetter('submodule_name'), reverse=True) + modules_for_directory = modules_by_directory.setdefault(directory, []) + while sorted_headers: + header = sorted_headers.pop() + module = Module(header) + modules_by_header[header] = module + index = -1 + for candidate_header in reversed(sorted_headers): + if ((not has_differing_transitive_includes(module, candidate_header, 'transitive_including_headers')) + and (not has_differing_transitive_includes(module, candidate_header, 'transitive_included_headers'))): + module.headers.append(candidate_header) + module.transitive_including_headers.discard(candidate_header) + module.transitive_included_headers.discard(candidate_header) + + modules_by_header[candidate_header] = module + del sorted_headers[index] + else: + index -= 1 + modules.append(module) + # Set up the modules for directory in reverse order so that they can + # be enumerated and trimmed in reverse order below in similar fashion + # to the headers here. + modules_for_directory.insert(0, module) + + # Replace the private headers in the modules' including/included headers with their new modules. + def replace_headers_with_modules(module: 'Module', headers_attribute: str, modules_attribute: str) -> None: + transitive_headers = getattr(module, headers_attribute) + transitive_modules = getattr(module, modules_attribute) + headers_with_modules = set() + for header in transitive_headers: + module_for_header = modules_by_header.get(header) + if module_for_header: + headers_with_modules.add(header) + transitive_modules.add(module_for_header) + transitive_headers -= headers_with_modules + + for module in modules: + replace_headers_with_modules(module, 'transitive_including_headers', 'transitive_including_modules') + replace_headers_with_modules(module, 'transitive_included_headers', 'transitive_included_modules') + + return modules_by_directory, modules + +def merge_modules(modules_by_directory: dict[str, 'Module'], all_modules: list['Module']) -> tuple[bool, dict[str, 'Module']]: + def merge_transitive_module_includes(surviving_module: 'Module', module_being_merged: 'Module', transitive_modules_attribute: str) -> None: + transitive_modules = getattr(surviving_module, transitive_modules_attribute) + transitive_modules |= getattr(module_being_merged, transitive_modules_attribute) + # If the modules being merged included each other, remove those references. + transitive_modules.discard(surviving_module) + transitive_modules.discard(module_being_merged) + + def update_transitive_module_includes(module: 'Module', surviving_module: 'Module', module_being_merged: 'Module', transitive_modules_attribute: str) -> None: + transitive_modules = getattr(module, transitive_modules_attribute) + if (surviving_module in transitive_modules) and (module_being_merged not in transitive_modules): + transitive_modules |= getattr(module_being_merged, transitive_modules_attribute) + if module_being_merged in transitive_modules: + if surviving_module not in transitive_modules: + transitive_modules.add(surviving_module) + transitive_modules |= getattr(surviving_module, transitive_modules_attribute) + transitive_modules.remove(module_being_merged) + + # Use the same double-reversed strategy as was used to enumerate the headers. + did_merge = False + merged_modules_by_directory = {} + for directory, modules_for_directory in modules_by_directory.items(): + merged_modules_for_directory = merged_modules_by_directory.setdefault(directory, []) + while modules_for_directory: + module = modules_for_directory.pop() + index = -1 + for candidate_module in reversed(modules_for_directory): + # Modules can be merged as long as it won't create a module cycle. Module a and b can be merged + # if none of b's including modules are included by a, and if none of a's including modules are + # included by b. The headers that don't have known modules are treated as if they're in their + # own standalone module, see the comment in build_modules. + if (candidate_module.transitive_including_headers.isdisjoint(module.transitive_included_headers) + and module.transitive_including_headers.isdisjoint(candidate_module.transitive_included_headers) + and candidate_module.transitive_including_modules.isdisjoint(module.transitive_included_modules) + and module.transitive_including_modules.isdisjoint(candidate_module.transitive_included_modules)): + # Update the rest of the modules with the merge. This needs to happen after every + # merge so that subsequent merge attempts can correctly identify cycles. For + # a1 -> b1, b2 -> a2, a1 and a2 will be merged into a1a2. b1 and b2 need to be + # updated to a1a2 -> b1, b2 -> a1a2 so that they don't get merged and create a cycle. + # Another scenario is a -> b, c -> d, e -> a. If d and e merge, c needs to not only + # replace d with de, but it also has to add all of e's transitive includes, i.e. a, + # so that c doesn't later merge with b and cause a cycle a -> bc -> de -> a. + all_modules.remove(candidate_module) + for module_to_update in all_modules: + update_transitive_module_includes(module_to_update, module, candidate_module, 'transitive_including_modules') + update_transitive_module_includes(module_to_update, module, candidate_module, 'transitive_included_modules') + + # Merge the candidate module. + module.headers += candidate_module.headers + module.transitive_including_headers |= candidate_module.transitive_including_headers + module.transitive_included_headers |= candidate_module.transitive_included_headers + merge_transitive_module_includes(module, candidate_module, 'transitive_including_modules') + merge_transitive_module_includes(module, candidate_module, 'transitive_included_modules') + + did_merge = True + del modules_for_directory[index] + else: + index -= 1 + merged_modules_for_directory.insert(0, module) + + return did_merge, merged_modules_by_directory + +def write_module_map(modules_by_directory: dict[str, ['Module']], libcxx_include_directory: str, intermediates_directory: str, header_module_attributes: dict[str, 'ModuleAttributes']) -> None: + # Figure out all of the module names to resolve the exports from the module attributes. + sorted_directories_and_modules = sorted(modules_by_directory.items(), key=operator.itemgetter(0)) + module_names_by_relative_include_path = {} + for directory, modules in sorted_directories_and_modules: + module_name_base = 'std_private' + if directory != libcxx_include_directory: + module_name_base += '_' + os.path.relpath(directory, libcxx_include_directory).lstrip('_').replace(os.path.sep, '_') + + module_number = 1 + use_module_number = len(modules) > 1 + + for module in modules: + module_name = module_name_base + if use_module_number: + module_name += '_' + str(module_number) + module.name = module_name + + for header in module.headers: + module_names_by_relative_include_path[header.libxcxx_include_relative_path] = module_name + '.' + header.submodule_name + + module_number += 1 + + with open(os.path.join(libcxx_include_directory, 'module.modulemap'), 'w') as destination_module_map: + # Append the dynamically generated private modules to the statically defined public modules in the + # intermediates directory. Public modules in the static module map export private modules using the + # header name in quotes as a placeholder. Replace that with the actual private module name. + export_regular_expression = re.compile(r'export ("(.*)")') + with open(os.path.join(intermediates_directory, 'module.modulemap')) as source_module_map: + for line in source_module_map: + line_to_write = line + match = export_regular_expression.search(line) + if match: + line_to_write = line[:match.start(1)] + line_to_write += module_names_by_relative_include_path[match[2]] + line_to_write += line[match.end(1):] + destination_module_map.write(line_to_write) + + for directory, modules in sorted_directories_and_modules: + for module in modules: + destination_module_map.write('module ') + destination_module_map.write(module.name) + destination_module_map.write(' [system] {') + + module_submodule_name_width = 0 + for header in module.headers: + submodule_name_length = len(header.submodule_name) + if submodule_name_length > module_submodule_name_width: + module_submodule_name_width = submodule_name_length + + for header in module.headers: + module_attributes = header_module_attributes.get(header.libxcxx_include_relative_path, {}) + needs_multiline = 'exports' in module_attributes + if not needs_multiline: + # configure_file might have configured all of the requires to "". + for requires in module_attributes.get('requires', []): + if requires: + needs_multiline = True + break + + destination_module_map.write('\n module ') + destination_module_map.write(header.submodule_name.ljust(module_submodule_name_width)) + + if needs_multiline: + destination_module_map.write(' {') + for requires in module_attributes.get('requires', []): + if requires: + destination_module_map.write('\n ') + destination_module_map.write(requires) + destination_module_map.write('\n ') + else: + destination_module_map.write(' { ') + + if module_attributes.get('textual'): + destination_module_map.write('textual ') + destination_module_map.write('header "') + destination_module_map.write(header.libxcxx_include_relative_path) + + if needs_multiline: + destination_module_map.write('"') + for export in module_attributes.get('exports', []): + # export can be a relative header path in the case of the + # private headers, a module name in the case of the statically + # declared modules, or "*". + exported_module = module_names_by_relative_include_path.get(export, export) + destination_module_map.write('\n export ') + destination_module_map.write(exported_module) + destination_module_map.write('\n }') + else: + destination_module_map.write('" }') + destination_module_map.write('\n}\n') + +def sanity_check_module_map(libcxx_include_directory: str, include_tree: typing.Iterable['Header']): + with open(os.path.join(libcxx_include_directory, 'module.modulemap')) as module_map_file: + module_map_contents = module_map_file.read() + missing_public_headers = [] + missing_private_headers = [] + public_headers_in_multiple_modules = [] + private_headers_in_multiple_modules = [] + for header in include_tree: + if not header.is_libxx_header: + continue + + # Super basic sanity check: make sure that every header selected by write_libcxx_includes + # ends up in exactly one module in the module map. + header_statement = 'header "' + header.libxcxx_include_relative_path + '"' + first_header_match = module_map_contents.find(header_statement) + if first_header_match == -1: + if header.is_private_libcxx_header: + missing_private_headers.append(header) + else: + missing_public_headers.append(header) + elif module_map_contents.find(header_statement, first_header_match + 1) != -1: + if header.is_private_libcxx_header: + private_headers_in_multiple_modules.append(header) + else: + public_headers_in_multiple_modules.append(header) + + if missing_public_headers: + print('module.modulemap.in is missing public headers:') + for header in missing_public_headers: + print(' ', header.libxcxx_include_relative_path) + print() + if missing_private_headers: + print('generate_module_map.py failed to generate modules for private headers:') + for header in missing_private_headers: + print(' ', header.libxcxx_include_relative_path) + print() + if public_headers_in_multiple_modules: + print('public headers in module.modulemap.in are in multiple modules:') + for header in public_headers_in_multiple_modules: + print(' ', header.libxcxx_include_relative_path) + print() + if private_headers_in_multiple_modules: + print('private headers generated by generate_module_map.py are in multiple modules:') + for header in private_headers_in_multiple_modules: + print(' ', header.libxcxx_include_relative_path) + print() + if missing_public_headers or missing_private_headers or public_headers_in_multiple_modules or private_headers_in_multiple_modules: + exit(1) + +class Header: + def __init__(self, path: str, libcxx_include_directory: str, header_module_attributes: dict[str, 'ModuleAttributes']) -> None: + self.path = path + if os.path.commonpath([path, libcxx_include_directory]) == libcxx_include_directory: + self.is_libxx_header = True + self.libxcxx_include_relative_path = os.path.relpath(path, libcxx_include_directory) + if self.libxcxx_include_relative_path.startswith('__'): + self.is_private_libcxx_header = True + + module_attributes = header_module_attributes.get(self.libxcxx_include_relative_path, {}) + + module_directory = module_attributes.get('module_directory', '') + if not module_directory: + module_directory_parent = os.path.dirname(self.libxcxx_include_relative_path) + while module_directory_parent: + module_directory = module_directory_parent + module_directory_parent = os.path.dirname(module_directory) + if module_directory: + self.module_directory = os.path.join(libcxx_include_directory, module_directory) + else: + self.module_directory = libcxx_include_directory + + submodule_name = module_attributes.get('submodule_name') + if submodule_name: + self.submodule_name = submodule_name + else: + if os.path.commonpath([path, self.module_directory]) == self.module_directory: + self.submodule_name = os.path.relpath(path, self.module_directory).replace(os.path.sep, '_').removesuffix('.h') + else: + self.submodule_name = os.path.basename(path).removesuffix('.h') + else: + self.is_private_libcxx_header = False + self.module_directory = os.path.dirname(path) + self.submodule_name = '' + else: + self.is_libxx_header = False + self.libxcxx_include_relative_path = '' + self.is_private_libcxx_header = False + self.module_directory = os.path.dirname(path) + self.submodule_name = '' + + self.including_headers = set() + self.included_headers = set() + self.transitive_including_headers = set() + self.transitive_included_headers = set() + + def __repr__(self) -> str: + return f'<{type(self).__name__} {self.path}>' + + def __hash__(self) -> int: + return hash(self.path) + + def __eq__(self, other) -> bool: + return self.path == other.path + + def __ne__(self, other) -> bool: + return self.path != other.path + + def __lt__(self, other) -> bool: + return self.path < other.path + + def __le__(self, other) -> bool: + return self.path <= other.path + + def __gt__(self, other) -> bool: + return self.path > other.path + + def __ge__(self, other) -> bool: + return self.path >= other.path + +class Module: + def __init__(self, header: Header) -> None: + self.name = '' + self.headers = [header] + self.transitive_including_headers = header.transitive_including_headers.copy() + self.transitive_included_headers = header.transitive_included_headers.copy() + self.transitive_including_modules = set() + self.transitive_included_modules = set() + + def __repr__(self) -> str: + return f'<{type(self).__name__} headers = {self.headers}>' + +class ModuleAttributes(typing.TypedDict, total=False): + exports: list[str] + module_directory: str + requires: list[str] + submodule_name: str + textual: bool + +main() diff --git a/libcxx/include/map b/libcxx/include/map --- a/libcxx/include/map +++ b/libcxx/include/map @@ -555,6 +555,7 @@ #include <__node_handle> #include <__tree> #include <__type_traits/is_allocator.h> +#include <__type_traits/type_identity.h> #include <__utility/forward.h> #include <__utility/piecewise_construct.h> #include <__utility/swap.h> diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in --- a/libcxx/include/module.modulemap.in +++ b/libcxx/include/module.modulemap.in @@ -1,1862 +1,628 @@ -// define the module for __config outside of the top level 'std' module -// since __config may be included from C headers which may create an -// include cycle. -module std_config [system] [extern_c] { - textual header "__config" +// 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] { + @requires_LIBCXX_ENABLE_THREADS@ + header "barrier" + export * +} +module std_bit [system] { + header "bit" + export * +} +module std_bitset [system] { + header "bitset" + export * +} +module std_charconv [system] { + header "charconv" + export * +} +module std_chrono [system] { + header "chrono" + export * +} +module std_codecvt [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + 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" + export * +} +module std_coroutine [system] { + header "coroutine" + 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] { + @requires_LIBCXX_ENABLE_FILESYSTEM@ + header "filesystem" + export * +} +module std_format [system] { + header "format" + export * +} +module std_forward_list [system] { + header "forward_list" + export * +} +module std_fstream [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + @requires_LIBCXX_ENABLE_FSTREAM@ + header "fstream" + export * +} +module std_functional [system] { + header "functional" + export * +} +module std_future [system] { + @requires_LIBCXX_ENABLE_THREADS@ + header "future" + export * +} +module std_initializer_list [system] { + header "initializer_list" + export * +} +module std_iomanip [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "iomanip" + export * +} +module std_ios [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "ios" + export * +} +module std_iosfwd [system] { + header "iosfwd" + export * +} +module std_iostream [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "iostream" + export * +} +module std_istream [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "istream" + export * +} +module std_iterator [system] { + header "iterator" + export * +} +module std_latch [system] { + @requires_LIBCXX_ENABLE_THREADS@ + header "latch" + export * +} +module std_limits [system] { + header "limits" + export * +} +module std_list [system] { + header "list" + export * +} +module std_locale [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "locale" + export * +} +module std_map [system] { + header "map" + export * +} +module std_memory [system] { + header "memory" + export * +} +module std_memory_resource [system] { + header "memory_resource" + export * +} +module std_mutex [system] { + @requires_LIBCXX_ENABLE_THREADS@ + 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] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "ostream" + 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] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "regex" + export * +} +module std_scoped_allocator [system] { + header "scoped_allocator" + export * +} +module std_semaphore [system] { + @requires_LIBCXX_ENABLE_THREADS@ + header "semaphore" + export * +} +module std_set [system] { + header "set" + export * +} +module std_shared_mutex [system] { + @requires_LIBCXX_ENABLE_THREADS@ + header "shared_mutex" + export std_version +} +module std_source_location [system] { + header "source_location" + export * +} +module std_span [system] { + header "span" + export "__ranges/enable_borrowed_range.h" + export "__fwd/span.h" + export std_version +} +module std_sstream [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "sstream" + export * +} +module std_stack [system] { + header "stack" + export * +} +module std_stdexcept [system] { + header "stdexcept" + export * +} +module std_streambuf [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "streambuf" + export * +} +module std_string [system] { + header "string" + export * +} +module std_string_view [system] { + header "string_view" + export * +} +module std_strstream [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "strstream" + export * +} +module std_system_error [system] { + header "system_error" + export * +} +module std_thread [system] { + @requires_LIBCXX_ENABLE_THREADS@ + 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 * } -module std [system] { - // FIXME: The standard does not require that each of these submodules - // re-exports its imported modules. We should provide an alternative form of - // export that issues a warning if a name from the submodule is used, and - // use that to provide a 'strict mode' for libc++. - - // Deprecated C-compatibility headers. These can all be included from within - // an 'extern "C"' context. - module depr [extern_c] { - // provided by C library. - module ctype_h { - header "ctype.h" - export * - } - module errno_h { - header "errno.h" - export * - } - module fenv_h { - header "fenv.h" - export * - } - // provided by compiler or C library. - module inttypes_h { - header "inttypes.h" - export stdint_h - export * - } - // provided by compiler. - // provided by compiler or C library. - module locale_h { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "locale.h" - export * - } - module math_h { - header "math.h" - export * - } - module setjmp_h { - header "setjmp.h" - export * - } - module stdatomic_h { - @requires_LIBCXX_ENABLE_THREADS@ - requires cplusplus23 - header "stdatomic.h" - export * - } - // FIXME: is missing. - // provided by C library. - // provided by compiler. - module stdbool_h { - // 's __bool_true_false_are_defined macro requires textual inclusion. - textual header "stdbool.h" - export * - } - module stddef_h { - // 's __need_* macros require textual inclusion. - textual header "stddef.h" - export * - } - module stdint_h { - header "stdint.h" - export * - // FIXME: This module only exists on OS X and for some reason the - // wildcard above doesn't export it. Removing this breaks the tests - // for C compatibility headers in C++17 mode with modules enabled. - export Darwin.C.stdint - } - module stdio_h { - // 's __need_* macros require textual inclusion. - textual header "stdio.h" - export * - } - module stdlib_h { - // 's __need_* macros require textual inclusion. - textual header "stdlib.h" - export * - } - module string_h { - header "string.h" - export * - } - module uchar_h { - header "uchar.h" - export * - } - // provided by C library. - module wchar_h { - @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ - // 's __need_* macros require textual inclusion. - textual header "wchar.h" - export * - } - module wctype_h { - @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ - header "wctype.h" - export * - } - } - - // and are not C headers in any real sense, do not - // allow their use in extern "C" contexts. - module complex_h { - header "complex.h" - export ccomplex - export * - } - module tgmath_h { - header "tgmath.h" - export ccomplex - export cmath - export * - } - - // C compatibility headers. - module compat { - module cassert { - // 's use of NDEBUG requires textual inclusion. - textual header "cassert" - } - module ccomplex { - header "ccomplex" - export complex - export * - } - module cctype { - header "cctype" - export * - } - module cerrno { - header "cerrno" - export * - } - module cfenv { - header "cfenv" - export * - } - module cfloat { - header "cfloat" - export * - } - module cinttypes { - header "cinttypes" - export cstdint - export * - } - module ciso646 { - header "ciso646" - export * - } - module climits { - header "climits" - export * - } - module clocale { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "clocale" - export * - } - module cmath { - header "cmath" - export * - } - module csetjmp { - header "csetjmp" - export * - } - module csignal { - header "csignal" - export * - } - // FIXME: is missing. - module cstdarg { - header "cstdarg" - export * - } - module cstdbool { - header "cstdbool" - export * - } - module cstddef { - header "cstddef" - export * - } - module cstdint { - header "cstdint" - export depr.stdint_h - export * - } - module cstdio { - header "cstdio" - export * - } - module cstdlib { - header "cstdlib" - export * - } - module cstring { - header "cstring" - export * - } - module ctgmath { - header "ctgmath" - export ccomplex - export cmath - export * - } - module ctime { - header "ctime" - export * - } - module cuchar { - header "cuchar" - export * - } - module cwchar { - @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ - header "cwchar" - export depr.stdio_h - export * - } - module cwctype { - @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ - header "cwctype" - export * - } - } - - module algorithm { - header "algorithm" - export initializer_list - export * - - module __algorithm { - module adjacent_find { private header "__algorithm/adjacent_find.h" } - module all_of { private header "__algorithm/all_of.h" } - module any_of { private header "__algorithm/any_of.h" } - module binary_search { private header "__algorithm/binary_search.h" } - module clamp { private header "__algorithm/clamp.h" } - module comp { private header "__algorithm/comp.h" } - module comp_ref_type { private header "__algorithm/comp_ref_type.h" } - module copy { private header "__algorithm/copy.h" } - module copy_backward { private header "__algorithm/copy_backward.h" } - module copy_if { private header "__algorithm/copy_if.h" } - module copy_move_common { private header "__algorithm/copy_move_common.h" } - module copy_n { private header "__algorithm/copy_n.h" } - module count { private header "__algorithm/count.h" } - module count_if { private header "__algorithm/count_if.h" } - module equal { private header "__algorithm/equal.h" } - module equal_range { private header "__algorithm/equal_range.h" } - module fill { private header "__algorithm/fill.h" } - module fill_n { private header "__algorithm/fill_n.h" } - module find { private header "__algorithm/find.h" } - module find_end { private header "__algorithm/find_end.h" } - module find_first_of { private header "__algorithm/find_first_of.h" } - module find_if { private header "__algorithm/find_if.h" } - module find_if_not { private header "__algorithm/find_if_not.h" } - module for_each { private header "__algorithm/for_each.h" } - module for_each_n { private header "__algorithm/for_each_n.h" } - module generate { private header "__algorithm/generate.h" } - module generate_n { private header "__algorithm/generate_n.h" } - module half_positive { private header "__algorithm/half_positive.h" } - module in_found_result { private header "__algorithm/in_found_result.h" } - module in_fun_result { private header "__algorithm/in_fun_result.h" } - module in_in_out_result { private header "__algorithm/in_in_out_result.h" } - module in_in_result { private header "__algorithm/in_in_result.h" } - module in_out_out_result { private header "__algorithm/in_out_out_result.h" } - module in_out_result { private header "__algorithm/in_out_result.h" } - module includes { private header "__algorithm/includes.h" } - module inplace_merge { private header "__algorithm/inplace_merge.h" } - module is_heap { private header "__algorithm/is_heap.h" } - module is_heap_until { private header "__algorithm/is_heap_until.h" } - module is_partitioned { private header "__algorithm/is_partitioned.h" } - module is_permutation { private header "__algorithm/is_permutation.h" } - module is_sorted { private header "__algorithm/is_sorted.h" } - module is_sorted_until { private header "__algorithm/is_sorted_until.h" } - module iter_swap { private header "__algorithm/iter_swap.h" } - module iterator_operations { - private header "__algorithm/iterator_operations.h" - export * - } - module lexicographical_compare { private header "__algorithm/lexicographical_compare.h" } - module lexicographical_compare_three_way { - private header "__algorithm/lexicographical_compare_three_way.h" - } - module lower_bound { private header "__algorithm/lower_bound.h" } - module make_heap { private header "__algorithm/make_heap.h" } - module make_projected { private header "__algorithm/make_projected.h" } - module max { private header "__algorithm/max.h" } - module max_element { private header "__algorithm/max_element.h" } - module merge { private header "__algorithm/merge.h" } - module min { private header "__algorithm/min.h" } - module min_element { private header "__algorithm/min_element.h" } - module min_max_result { private header "__algorithm/min_max_result.h" } - module minmax { - private header "__algorithm/minmax.h" - export * - } - module minmax_element { private header "__algorithm/minmax_element.h" } - module mismatch { private header "__algorithm/mismatch.h" } - module move { private header "__algorithm/move.h" } - module move_backward { private header "__algorithm/move_backward.h" } - module next_permutation { private header "__algorithm/next_permutation.h" } - module none_of { private header "__algorithm/none_of.h" } - module nth_element { private header "__algorithm/nth_element.h" } - module partial_sort { private header "__algorithm/partial_sort.h" } - module partial_sort_copy { private header "__algorithm/partial_sort_copy.h" } - module partition { private header "__algorithm/partition.h" } - module partition_copy { private header "__algorithm/partition_copy.h" } - module partition_point { private header "__algorithm/partition_point.h" } - module pop_heap { private header "__algorithm/pop_heap.h" } - module prev_permutation { private header "__algorithm/prev_permutation.h" } - module pstl_backends_cpu_backend { - private header "__algorithm/pstl_backends/cpu_backend.h" - export * - } - module pstl_backends_cpu_backends_any_of { - private header "__algorithm/pstl_backends/cpu_backends/any_of.h" - } - module pstl_backends_cpu_backends_backend { - private header "__algorithm/pstl_backends/cpu_backends/backend.h" - export * - } - module pstl_backends_cpu_backends_fill { private header "__algorithm/pstl_backends/cpu_backends/fill.h" } - module pstl_backends_cpu_backends_find_if { - private header "__algorithm/pstl_backends/cpu_backends/find_if.h" - } - module pstl_backends_cpu_backends_for_each { - private header "__algorithm/pstl_backends/cpu_backends/for_each.h" - } - module pstl_backends_cpu_backends_serial { - private header "__algorithm/pstl_backends/cpu_backends/serial.h" - } - module pstl_backends_cpu_backends_transform { - private header "__algorithm/pstl_backends/cpu_backends/transform.h" - } - module push_heap { private header "__algorithm/push_heap.h" } - module ranges_adjacent_find { private header "__algorithm/ranges_adjacent_find.h" } - module ranges_all_of { private header "__algorithm/ranges_all_of.h" } - module ranges_any_of { private header "__algorithm/ranges_any_of.h" } - module ranges_binary_search { - private header "__algorithm/ranges_binary_search.h" - export functional.__functional.ranges_operations - } - module ranges_clamp { - private header "__algorithm/ranges_clamp.h" - export functional.__functional.ranges_operations - } - module ranges_copy { - private header "__algorithm/ranges_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_copy_backward { - private header "__algorithm/ranges_copy_backward.h" - export algorithm.__algorithm.in_out_result - } - module ranges_copy_if { - private header "__algorithm/ranges_copy_if.h" - export algorithm.__algorithm.in_out_result - } - module ranges_copy_n { - private header "__algorithm/ranges_copy_n.h" - export algorithm.__algorithm.in_out_result - } - module ranges_count { private header "__algorithm/ranges_count.h" } - module ranges_count_if { private header "__algorithm/ranges_count_if.h" } - module ranges_equal { private header "__algorithm/ranges_equal.h" } - module ranges_equal_range { - private header "__algorithm/ranges_equal_range.h" - export functional.__functional.ranges_operations - } - module ranges_fill { private header "__algorithm/ranges_fill.h" } - module ranges_fill_n { private header "__algorithm/ranges_fill_n.h" } - module ranges_find { private header "__algorithm/ranges_find.h" } - module ranges_find_end { private header "__algorithm/ranges_find_end.h" } - module ranges_find_first_of { private header "__algorithm/ranges_find_first_of.h" } - module ranges_find_if { private header "__algorithm/ranges_find_if.h" } - module ranges_find_if_not { private header "__algorithm/ranges_find_if_not.h" } - module ranges_for_each { - private header "__algorithm/ranges_for_each.h" - export algorithm.__algorithm.in_fun_result - } - module ranges_for_each_n { - private header "__algorithm/ranges_for_each_n.h" - export algorithm.__algorithm.in_fun_result - } - module ranges_generate { private header "__algorithm/ranges_generate.h" } - module ranges_generate_n { private header "__algorithm/ranges_generate_n.h" } - module ranges_includes { - private header "__algorithm/ranges_includes.h" - export functional.__functional.ranges_operations - } - module ranges_inplace_merge { - private header "__algorithm/ranges_inplace_merge.h" - export functional.__functional.ranges_operations - } - module ranges_is_heap { - private header "__algorithm/ranges_is_heap.h" - export functional.__functional.ranges_operations - } - module ranges_is_heap_until { - private header "__algorithm/ranges_is_heap_until.h" - export functional.__functional.ranges_operations - } - module ranges_is_partitioned { private header "__algorithm/ranges_is_partitioned.h" } - module ranges_is_permutation { private header "__algorithm/ranges_is_permutation.h" } - module ranges_is_sorted { - private header "__algorithm/ranges_is_sorted.h" - export functional.__functional.ranges_operations - } - module ranges_is_sorted_until { - private header "__algorithm/ranges_is_sorted_until.h" - export functional.__functional.ranges_operations - } - module ranges_iterator_concept { private header "__algorithm/ranges_iterator_concept.h" } - module ranges_lexicographical_compare { - private header "__algorithm/ranges_lexicographical_compare.h" - export functional.__functional.ranges_operations - } - module ranges_lower_bound { - private header "__algorithm/ranges_lower_bound.h" - export functional.__functional.ranges_operations - } - module ranges_make_heap { - private header "__algorithm/ranges_make_heap.h" - export functional.__functional.ranges_operations - } - module ranges_max { - private header "__algorithm/ranges_max.h" - export functional.__functional.ranges_operations - } - module ranges_max_element { - private header "__algorithm/ranges_max_element.h" - export functional.__functional.ranges_operations - } - module ranges_merge { - private header "__algorithm/ranges_merge.h" - export algorithm.__algorithm.in_in_out_result - } - module ranges_min { - private header "__algorithm/ranges_min.h" - export functional.__functional.ranges_operations - } - module ranges_min_element { - private header "__algorithm/ranges_min_element.h" - export functional.__functional.ranges_operations - } - module ranges_minmax { - private header "__algorithm/ranges_minmax.h" - export functional.__functional.ranges_operations - export algorithm.__algorithm.min_max_result - } - module ranges_minmax_element { - private header "__algorithm/ranges_minmax_element.h" - export functional.__functional.ranges_operations - export algorithm.__algorithm.min_max_result - } - module ranges_mismatch { - private header "__algorithm/ranges_mismatch.h" - export algorithm.__algorithm.in_in_result - } - module ranges_move { - private header "__algorithm/ranges_move.h" - export algorithm.__algorithm.in_out_result - } - module ranges_move_backward { - private header "__algorithm/ranges_move_backward.h" - export algorithm.__algorithm.in_out_result - } - module ranges_next_permutation { - private header "__algorithm/ranges_next_permutation.h" - export algorithm.__algorithm.in_found_result - export functional.__functional.ranges_operations - } - module ranges_none_of { private header "__algorithm/ranges_none_of.h" } - module ranges_nth_element { - private header "__algorithm/ranges_nth_element.h" - export functional.__functional.ranges_operations - } - module ranges_partial_sort { - private header "__algorithm/ranges_partial_sort.h" - export algorithm.__algorithm.in_out_result - export functional.__functional.ranges_operations - } - module ranges_partial_sort_copy { - private header "__algorithm/ranges_partial_sort_copy.h" - export algorithm.__algorithm.in_out_out_result - export functional.__functional.ranges_operations - } - module ranges_partition { private header "__algorithm/ranges_partition.h" } - module ranges_partition_copy { private header "__algorithm/ranges_partition_copy.h" } - module ranges_partition_point { private header "__algorithm/ranges_partition_point.h" } - module ranges_pop_heap { - private header "__algorithm/ranges_pop_heap.h" - export functional.__functional.ranges_operations - } - module ranges_prev_permutation { - private header "__algorithm/ranges_prev_permutation.h" - export algorithm.__algorithm.in_found_result - export functional.__functional.ranges_operations - } - module ranges_push_heap { - private header "__algorithm/ranges_push_heap.h" - export functional.__functional.ranges_operations - } - module ranges_remove { private header "__algorithm/ranges_remove.h" } - module ranges_remove_copy { - private header "__algorithm/ranges_remove_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_remove_copy_if { - private header "__algorithm/ranges_remove_copy_if.h" - export algorithm.__algorithm.in_out_result - } - module ranges_remove_if { private header "__algorithm/ranges_remove_if.h" } - module ranges_replace { private header "__algorithm/ranges_replace.h" } - module ranges_replace_copy { - private header "__algorithm/ranges_replace_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_replace_copy_if { - private header "__algorithm/ranges_replace_copy_if.h" - export algorithm.__algorithm.in_out_result - } - module ranges_replace_if { private header "__algorithm/ranges_replace_if.h" } - module ranges_reverse { private header "__algorithm/ranges_reverse.h" } - module ranges_reverse_copy { - private header "__algorithm/ranges_reverse_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_rotate { private header "__algorithm/ranges_rotate.h" } - module ranges_rotate_copy { - private header "__algorithm/ranges_rotate_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_sample { private header "__algorithm/ranges_sample.h" } - module ranges_search { private header "__algorithm/ranges_search.h" } - module ranges_search_n { private header "__algorithm/ranges_search_n.h" } - module ranges_set_difference { - private header "__algorithm/ranges_set_difference.h" - export algorithm.__algorithm.in_out_result - } - module ranges_set_intersection { - private header "__algorithm/ranges_set_intersection.h" - export algorithm.__algorithm.in_in_out_result - } - module ranges_set_symmetric_difference { - private header "__algorithm/ranges_set_symmetric_difference.h" - export algorithm.__algorithm.in_in_out_result - export functional.__functional.ranges_operations - } - module ranges_set_union { - private header "__algorithm/ranges_set_union.h" - export algorithm.__algorithm.in_in_out_result - export functional.__functional.ranges_operations - } - module ranges_shuffle { private header "__algorithm/ranges_shuffle.h" } - module ranges_sort { - private header "__algorithm/ranges_sort.h" - export functional.__functional.ranges_operations - } - module ranges_sort_heap { - private header "__algorithm/ranges_sort_heap.h" - export functional.__functional.ranges_operations - } - module ranges_stable_partition { private header "__algorithm/ranges_stable_partition.h" } - module ranges_stable_sort { - private header "__algorithm/ranges_stable_sort.h" - export functional.__functional.ranges_operations - } - module ranges_starts_with { private header "__algorithm/ranges_starts_with.h" } - module ranges_swap_ranges { - private header "__algorithm/ranges_swap_ranges.h" - export algorithm.__algorithm.in_in_result - } - module ranges_transform { - private header "__algorithm/ranges_transform.h" - export algorithm.__algorithm.in_in_out_result - export algorithm.__algorithm.in_out_result - } - module uniform_random_bit_generator_adaptor { - private header "__algorithm/uniform_random_bit_generator_adaptor.h" - } - module ranges_unique { private header "__algorithm/ranges_unique.h" } - module ranges_unique_copy { - private header "__algorithm/ranges_unique_copy.h" - export algorithm.__algorithm.in_out_result - } - module ranges_upper_bound { - private header "__algorithm/ranges_upper_bound.h" - export functional.__functional.ranges_operations - } - module remove { private header "__algorithm/remove.h" } - module remove_copy { private header "__algorithm/remove_copy.h" } - module remove_copy_if { private header "__algorithm/remove_copy_if.h" } - module remove_if { private header "__algorithm/remove_if.h" } - module replace { private header "__algorithm/replace.h" } - module replace_copy { private header "__algorithm/replace_copy.h" } - module replace_copy_if { private header "__algorithm/replace_copy_if.h" } - module replace_if { private header "__algorithm/replace_if.h" } - module reverse { private header "__algorithm/reverse.h" } - module reverse_copy { private header "__algorithm/reverse_copy.h" } - module rotate { private header "__algorithm/rotate.h" } - module rotate_copy { private header "__algorithm/rotate_copy.h" } - module sample { private header "__algorithm/sample.h" } - module search { private header "__algorithm/search.h" } - module search_n { private header "__algorithm/search_n.h" } - module set_difference { private header "__algorithm/set_difference.h" } - module set_intersection { private header "__algorithm/set_intersection.h" } - module set_symmetric_difference { private header "__algorithm/set_symmetric_difference.h" } - module set_union { private header "__algorithm/set_union.h" } - module shift_left { private header "__algorithm/shift_left.h" } - module shift_right { private header "__algorithm/shift_right.h" } - module shuffle { private header "__algorithm/shuffle.h" } - module sift_down { private header "__algorithm/sift_down.h" } - module sort { private header "__algorithm/sort.h" } - module sort_heap { private header "__algorithm/sort_heap.h" } - module stable_partition { private header "__algorithm/stable_partition.h" } - module stable_sort { private header "__algorithm/stable_sort.h" } - module swap_ranges { private header "__algorithm/swap_ranges.h" } - module three_way_comp_ref_type { private header "__algorithm/three_way_comp_ref_type.h" } - module transform { private header "__algorithm/transform.h" } - module unique { private header "__algorithm/unique.h" } - module unique_copy { private header "__algorithm/unique_copy.h" } - module unwrap_iter { private header "__algorithm/unwrap_iter.h" } - module unwrap_range { - private header "__algorithm/unwrap_range.h" - export utility.__utility.pair - } - module upper_bound { private header "__algorithm/upper_bound.h" } - } - } - module any { - header "any" - export * - } - module array { - header "array" - export initializer_list - export * - - module array_fwd { private header "__fwd/array.h" } - } - module atomic { - header "atomic" - export * - - module __atomic { - module aliases { - private header "__atomic/aliases.h" - export atomic - } - module atomic { - private header "__atomic/atomic.h" - - export atomic_base - } - module atomic_base { private header "__atomic/atomic_base.h" } - module atomic_flag { private header "__atomic/atomic_flag.h" } - module atomic_init { private header "__atomic/atomic_init.h" } - module atomic_lock_free { private header "__atomic/atomic_lock_free.h" } - module atomic_sync { private header "__atomic/atomic_sync.h" } - module check_memory_order { private header "__atomic/check_memory_order.h" } - module contention_t { private header "__atomic/contention_t.h" } - module cxx_atomic_impl { private header "__atomic/cxx_atomic_impl.h" } - module fence { private header "__atomic/fence.h" } - module is_always_lock_free { private header "__atomic/is_always_lock_free.h" } - module kill_dependency { private header "__atomic/kill_dependency.h" } - module memory_order { private header "__atomic/memory_order.h" } - } - } - module barrier { - @requires_LIBCXX_ENABLE_THREADS@ - header "barrier" - export * - } - module bit { - header "bit" - export * - - module __bit { - module bit_cast { private header "__bit/bit_cast.h" } - module bit_ceil { private header "__bit/bit_ceil.h" } - module bit_floor { private header "__bit/bit_floor.h" } - module bit_log2 { private header "__bit/bit_log2.h" } - module bit_width { private header "__bit/bit_width.h" } - module blsr { private header "__bit/blsr.h" } - module byteswap { private header "__bit/byteswap.h" } - module countl { private header "__bit/countl.h" } - module countr { private header "__bit/countr.h" } - module endian { private header "__bit/endian.h" } - module has_single_bit { private header "__bit/has_single_bit.h" } - module popcount { private header "__bit/popcount.h" } - module rotate { private header "__bit/rotate.h" } - } - } - module bitset { - header "bitset" - export string - export iosfwd - export * - } - // No submodule for cassert. It fundamentally needs repeated, textual inclusion. - module charconv { - header "charconv" - export * - - module __charconv { - module chars_format { private header "__charconv/chars_format.h" } - module from_chars_integral { private header "__charconv/from_chars_integral.h" } - module from_chars_result { private header "__charconv/from_chars_result.h" } - module tables { private header "__charconv/tables.h" } - module to_chars { private header "__charconv/to_chars.h" } - module to_chars_base_10 { private header "__charconv/to_chars_base_10.h" } - module to_chars_floating_point { private header "__charconv/to_chars_floating_point.h" } - module to_chars_integral { private header "__charconv/to_chars_integral.h" } - module to_chars_result { private header "__charconv/to_chars_result.h" } - module traits { private header "__charconv/traits.h" } - } - - } - module chrono { - header "chrono" - export * - - module __chrono { - module calendar { private header "__chrono/calendar.h" } - module concepts { private header "__chrono/concepts.h" } - module convert_to_timespec { private header "__chrono/convert_to_timespec.h" } - module convert_to_tm { private header "__chrono/convert_to_tm.h" } - module day { private header "__chrono/day.h" } - module duration { private header "__chrono/duration.h" } - module file_clock { private header "__chrono/file_clock.h" } - module formatter { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - private header "__chrono/formatter.h" - } - module hh_mm_ss { private header "__chrono/hh_mm_ss.h" } - module high_resolution_clock { - private header "__chrono/high_resolution_clock.h" - export steady_clock - export system_clock - export time_point - } - module literals { private header "__chrono/literals.h" } - module month { private header "__chrono/month.h" } - module month_weekday { private header "__chrono/month_weekday.h" } - module monthday { private header "__chrono/monthday.h" } - module ostream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - private header "__chrono/ostream.h" - } - module parser_std_format_spec { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - private header "__chrono/parser_std_format_spec.h" - } - module statically_widen { private header "__chrono/statically_widen.h" } - module steady_clock { private header "__chrono/steady_clock.h" } - module system_clock { private header "__chrono/system_clock.h" } - module time_point { private header "__chrono/time_point.h" } - module weekday { private header "__chrono/weekday.h" } - module year { private header "__chrono/year.h" } - module year_month { private header "__chrono/year_month.h" } - module year_month_day { private header "__chrono/year_month_day.h" } - module year_month_weekday { private header "__chrono/year_month_weekday.h" } - } - } - module codecvt { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "codecvt" - export * - } - module compare { - header "compare" - export * - - module __compare { - module common_comparison_category { private header "__compare/common_comparison_category.h" } - module compare_partial_order_fallback { private header "__compare/compare_partial_order_fallback.h" } - module compare_strong_order_fallback { private header "__compare/compare_strong_order_fallback.h" } - module compare_three_way { private header "__compare/compare_three_way.h" } - module compare_three_way_result { private header "__compare/compare_three_way_result.h" } - module compare_weak_order_fallback { private header "__compare/compare_weak_order_fallback.h" } - module is_eq { private header "__compare/is_eq.h" } - module ordering { private header "__compare/ordering.h" } - module partial_order { private header "__compare/partial_order.h" } - module strong_order { private header "__compare/strong_order.h" } - module synth_three_way { private header "__compare/synth_three_way.h" } - module three_way_comparable { private header "__compare/three_way_comparable.h" } - module weak_order { private header "__compare/weak_order.h" } - } - } - module complex { - header "complex" - export * - } - module concepts { - header "concepts" - export * +// C standard library interface wrappers +module std_cassert [system] { + // '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] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + 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: is missing. +module std_cstdarg [system] { + header "cstdarg" + export * +} +module std_cstdbool [system] { + header "cstdbool" + export * +} +module std_cstddef [system] { + header "cstddef" + 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] { + @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ + header "cwchar" + export * +} +module std_cwctype [system] { + @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ + header "cwctype" + export * +} - module __concepts { - module arithmetic { private header "__concepts/arithmetic.h" } - module assignable { private header "__concepts/assignable.h" } - module boolean_testable { private header "__concepts/boolean_testable.h" } - module class_or_enum { private header "__concepts/class_or_enum.h" } - module common_reference_with { private header "__concepts/common_reference_with.h" } - module common_with { private header "__concepts/common_with.h" } - module constructible { private header "__concepts/constructible.h" } - module convertible_to { private header "__concepts/convertible_to.h" } - module copyable { private header "__concepts/copyable.h" } - module derived_from { private header "__concepts/derived_from.h" } - module destructible { private header "__concepts/destructible.h" } - module different_from { private header "__concepts/different_from.h" } - module equality_comparable { - private header "__concepts/equality_comparable.h" - export type_traits.common_reference - } - module invocable { private header "__concepts/invocable.h" } - module movable { private header "__concepts/movable.h" } - module predicate { private header "__concepts/predicate.h" } - module regular { private header "__concepts/regular.h" } - module relation { private header "__concepts/relation.h" } - module same_as { - private header "__concepts/same_as.h" - export type_traits.is_same - } - module semiregular { private header "__concepts/semiregular.h" } - module swappable { private header "__concepts/swappable.h" } - module totally_ordered { private header "__concepts/totally_ordered.h" } - } - } - module condition_variable { - header "condition_variable" - export * +// C standard library interfaces augmented/replaced in C++ +// provided by C library. +module std_complex_h [system] { + header "complex.h" + export * +} +module std_ctype_h [system] { + header "ctype.h" + export * +} +module std_errno_h [system] { + header "errno.h" + export * +} +module std_fenv_h [system] { + header "fenv.h" + export * +} +module std_float_h [system] { + header "float.h" + export * +} +module std_inttypes_h [system] { + header "inttypes.h" + export * +} +// provided by compiler. +module std_limits_h [system] { + header "limits.h" + export * +} +module std_locale_h [system] { + @requires_LIBCXX_ENABLE_LOCALIZATION@ + header "locale.h" + export * +} +module std_math_h [system] { + header "math.h" + export * +} +module std_setjmp_h [system] { + header "setjmp.h" + export * +} +// provided by C library. +// FIXME: is missing. +// provided by compiler. +module std_stdatomic_h [system] { + @requires_LIBCXX_ENABLE_THREADS@ + requires cplusplus23 + header "stdatomic.h" + export * +} +module std_stdbool_h [system] { + // 's __bool_true_false_are_defined macro requires textual inclusion. + textual header "stdbool.h" + export * +} +module std_stddef_h [system] { + // 's __need_* macros require textual inclusion. + textual header "stddef.h" + export * +} +module std_stdint_h [system] { + header "stdint.h" + export * + // FIXME: This module only exists on OS X and for some reason the + // wildcard above doesn't export it. Removing this breaks the tests + // for C compatibility headers in C++17 mode with modules enabled. +// export Darwin.C.stdint +} +module std_stdio_h [system] { + // 's __need_* macros require textual inclusion. + textual header "stdio.h" + export * +} +module std_stdlib_h [system] { + // 's __need_* macros require textual inclusion. + textual header "stdlib.h" + export * +} +module std_string_h [system] { + header "string.h" + export * +} +module std_tgmath_h [system] { + header "tgmath.h" + export * +} +module std_uchar_h [system] { + header "uchar.h" + export * +} +// provided by C library. +module std_wchar_h [system] { + @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ + // 's __need_* macros require textual inclusion. + textual header "wchar.h" + export * +} +module std_wctype_h [system] { + @requires_LIBCXX_ENABLE_WIDE_CHARACTERS@ + header "wctype.h" + export * +} - module __condition_variable { - module condition_variable { private header "__condition_variable/condition_variable.h" } - } - } - module coroutine { - header "coroutine" - export compare - export * +// Experimental C++ standard library interfaces +module std_experimental [system] { + requires cplusplus11 - module __coroutine { - module coroutine_handle { private header "__coroutine/coroutine_handle.h" } - module coroutine_traits { private header "__coroutine/coroutine_traits.h" } - module noop_coroutine_handle { private header "__coroutine/noop_coroutine_handle.h" } - module trivial_awaitables { private header "__coroutine/trivial_awaitables.h" } - } - } module deque { - header "deque" - export initializer_list - export * - } - module exception { - header "exception" - export * - - module __exception { - module exception { private header "__exception/exception.h" } - module exception_ptr { private header "__exception/exception_ptr.h" } - module nested_exception { private header "__exception/nested_exception.h" } - module operations { private header "__exception/operations.h" } - module terminate { private header "__exception/terminate.h" } - } - } - module execution { - header "execution" - export * - } - module expected { - header "expected" - export * - - module __expected { - module bad_expected_access { private header "__expected/bad_expected_access.h" } - module expected { private header "__expected/expected.h" } - module unexpect { private header "__expected/unexpect.h" } - module unexpected { private header "__expected/unexpected.h" } - } - } - module filesystem { - @requires_LIBCXX_ENABLE_FILESYSTEM@ - header "filesystem" + header "experimental/deque" export * - - module __filesystem { - module copy_options { private header "__filesystem/copy_options.h" } - module directory_entry { private header "__filesystem/directory_entry.h" } - module directory_iterator { private header "__filesystem/directory_iterator.h" } - module directory_options { private header "__filesystem/directory_options.h" } - module file_status { private header "__filesystem/file_status.h" } - module file_time_type { private header "__filesystem/file_time_type.h" } - module file_type { private header "__filesystem/file_type.h" } - module filesystem_error { private header "__filesystem/filesystem_error.h" } - module operations { private header "__filesystem/operations.h" } - module path { - private header "__filesystem/path.h" - export functional.__functional.hash - export functional.__functional.unary_function - } - module path_iterator { private header "__filesystem/path_iterator.h" } - module perm_options { private header "__filesystem/perm_options.h" } - module perms { private header "__filesystem/perms.h" } - module recursive_directory_iterator { private header "__filesystem/recursive_directory_iterator.h" } - module space_info { private header "__filesystem/space_info.h" } - module u8path { private header "__filesystem/u8path.h" } - } - } - module format { - header "format" - export * - - module __format { - module buffer { private header "__format/buffer.h" } - module concepts { private header "__format/concepts.h" } - module container_adaptor { private header "__format/container_adaptor.h" } - module enable_insertable { private header "__format/enable_insertable.h" } - module escaped_output_table { private header "__format/escaped_output_table.h" } - module extended_grapheme_cluster_table { private header "__format/extended_grapheme_cluster_table.h" } - module format_arg { private header "__format/format_arg.h" } - module format_arg_store { private header "__format/format_arg_store.h" } - module format_args { private header "__format/format_args.h" } - module format_context { - private header "__format/format_context.h" - export optional - export locale - export __locale - } - module format_error { private header "__format/format_error.h" } - module format_functions { - private header "__format/format_functions.h" - export string - } - module format_fwd { private header "__format/format_fwd.h" } - module format_parse_context { private header "__format/format_parse_context.h" } - module format_string { private header "__format/format_string.h" } - module format_to_n_result { - private header "__format/format_to_n_result.h" - export iterator.__iterator.incrementable_traits - } - module formatter { private header "__format/formatter.h" } - module formatter_bool { private header "__format/formatter_bool.h" } - module formatter_char { private header "__format/formatter_char.h" } - module formatter_floating_point { private header "__format/formatter_floating_point.h" } - module formatter_integer { private header "__format/formatter_integer.h" } - module formatter_integral { private header "__format/formatter_integral.h" } - module formatter_output { private header "__format/formatter_output.h" } - module formatter_pointer { private header "__format/formatter_pointer.h" } - module formatter_string { private header "__format/formatter_string.h" } - module formatter_tuple { private header "__format/formatter_tuple.h" } - module parser_std_format_spec { private header "__format/parser_std_format_spec.h" } - module range_default_formatter { private header "__format/range_default_formatter.h" } - module range_formatter { private header "__format/range_formatter.h" } - module unicode { private header "__format/unicode.h" } - module width_estimation_table { private header "__format/width_estimation_table.h" } - } } module forward_list { - header "forward_list" - export initializer_list - export * - } - module fstream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - @requires_LIBCXX_ENABLE_FSTREAM@ - header "fstream" - export * - } - module functional { - header "functional" - // the contents of __type_traits/unwrap_ref.h should be available from functional too. - export type_traits.unwrap_ref - export * - - module __functional { - module binary_function { private header "__functional/binary_function.h" } - module binary_negate { private header "__functional/binary_negate.h" } - module bind { private header "__functional/bind.h" } - module bind_back { private header "__functional/bind_back.h" } - module bind_front { private header "__functional/bind_front.h" } - module binder1st { private header "__functional/binder1st.h" } - module binder2nd { private header "__functional/binder2nd.h" } - module boyer_moore_searcher { private header "__functional/boyer_moore_searcher.h" } - module compose { private header "__functional/compose.h" } - module default_searcher { private header "__functional/default_searcher.h" } - module function { private header "__functional/function.h" } - module hash { private header "__functional/hash.h" } - module hash_fwd { private header "__fwd/hash.h" } - module identity { private header "__functional/identity.h" } - module invoke { - private header "__functional/invoke.h" - export type_traits - } - module is_transparent { private header "__functional/is_transparent.h" } - module mem_fn { private header "__functional/mem_fn.h" } - module mem_fun_ref { private header "__functional/mem_fun_ref.h" } - module not_fn { private header "__functional/not_fn.h" } - module operations { private header "__functional/operations.h" } - module perfect_forward { private header "__functional/perfect_forward.h" } - module pointer_to_binary_function { private header "__functional/pointer_to_binary_function.h" } - module pointer_to_unary_function { private header "__functional/pointer_to_unary_function.h" } - module ranges_operations { private header "__functional/ranges_operations.h" } - module reference_wrapper { private header "__functional/reference_wrapper.h" } - module unary_function { private header "__functional/unary_function.h" } - module unary_negate { private header "__functional/unary_negate.h" } - module weak_result_type { private header "__functional/weak_result_type.h" } - } - } - module future { - @requires_LIBCXX_ENABLE_THREADS@ - header "future" - export * - } - module initializer_list { - header "initializer_list" - export * - } - module iomanip { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "iomanip" - export * - } - module ios { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "ios" - export iosfwd - export * - - module __ios { - module fpos { private header "__ios/fpos.h" } - } - } - module iosfwd { - header "iosfwd" - export * - module __iosfwd { - module fstream_fwd { private header "__fwd/fstream.h" } - module ios_fwd { private header "__fwd/ios.h" } - module istream_fwd { private header "__fwd/istream.h" } - module ostream_fwd { private header "__fwd/ostream.h" } - module sstream_fwd { private header "__fwd/sstream.h" } - module streambuf_fwd { private header "__fwd/streambuf.h" } - } - } - module iostream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "iostream" - export ios - export streambuf - export istream - export ostream - export * - } - module istream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "istream" - // FIXME: should re-export ios, streambuf? + header "experimental/forward_list" export * } module iterator { - header "iterator" - export * - - module __iterator { - module access { private header "__iterator/access.h" } - module advance { private header "__iterator/advance.h" } - module back_insert_iterator { private header "__iterator/back_insert_iterator.h" } - module bounded_iter { private header "__iterator/bounded_iter.h" } - module common_iterator { private header "__iterator/common_iterator.h" } - module concepts { - private header "__iterator/concepts.h" - export concepts.equality_comparable - export type_traits.common_reference - } - module counted_iterator { private header "__iterator/counted_iterator.h" } - module data { private header "__iterator/data.h" } - module default_sentinel { private header "__iterator/default_sentinel.h" } - module distance { private header "__iterator/distance.h" } - module empty { private header "__iterator/empty.h" } - module erase_if_container { private header "__iterator/erase_if_container.h" } - module front_insert_iterator { private header "__iterator/front_insert_iterator.h" } - module incrementable_traits { private header "__iterator/incrementable_traits.h" } - module indirectly_comparable { private header "__iterator/indirectly_comparable.h" } - module insert_iterator { private header "__iterator/insert_iterator.h" } - module istream_iterator { private header "__iterator/istream_iterator.h" } - module istreambuf_iterator { private header "__iterator/istreambuf_iterator.h" } - module iter_move { private header "__iterator/iter_move.h" } - module iter_swap { private header "__iterator/iter_swap.h" } - module iterator { private header "__iterator/iterator.h" } - module iterator_traits { private header "__iterator/iterator_traits.h" } - module iterator_with_data { private header "__iterator/iterator_with_data.h" } - module mergeable { - private header "__iterator/mergeable.h" - export functional.__functional.ranges_operations - } - module move_iterator { private header "__iterator/move_iterator.h" } - module move_sentinel { private header "__iterator/move_sentinel.h" } - module next { private header "__iterator/next.h" } - module ostream_iterator { private header "__iterator/ostream_iterator.h" } - module ostreambuf_iterator { - private header "__iterator/ostreambuf_iterator.h" - export iosfwd - } - module permutable { private header "__iterator/permutable.h" } - module prev { private header "__iterator/prev.h" } - module projected { private header "__iterator/projected.h" } - module readable_traits { - private header "__iterator/readable_traits.h" - export __iterator.iterator_traits - } - module reverse_access { private header "__iterator/reverse_access.h" } - module reverse_iterator { private header "__iterator/reverse_iterator.h" } - module segmented_iterator { private header "__iterator/segmented_iterator.h" } - module size { private header "__iterator/size.h" } - module sortable { - private header "__iterator/sortable.h" - export functional.__functional.ranges_operations - } - module unreachable_sentinel { private header "__iterator/unreachable_sentinel.h" } - module wrap_iter { private header "__iterator/wrap_iter.h" } - } - } - module latch { - @requires_LIBCXX_ENABLE_THREADS@ - header "latch" - export * - } - - module __debug_utils { - module randomize_range { private header "__debug_utils/randomize_range.h" } - } - - module limits { - header "limits" + header "experimental/iterator" export * } module list { - header "list" - export initializer_list - export * - } - module locale { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "locale" + header "experimental/list" export * } module map { - header "map" - export initializer_list + header "experimental/map" export * } - module memory { - header "memory" - export * - - module __memory { - module addressof { private header "__memory/addressof.h" } - module align { private header "__memory/align.h" } - module aligned_alloc { private header "__memory/aligned_alloc.h" } - module allocate_at_least { private header "__memory/allocate_at_least.h" } - module allocation_guard { private header "__memory/allocation_guard.h" } - module allocator { private header "__memory/allocator.h" } - module allocator_arg_t { private header "__memory/allocator_arg_t.h" } - module allocator_destructor { private header "__memory/allocator_destructor.h" } - module allocator_traits { private header "__memory/allocator_traits.h" } - module assume_aligned { private header "__memory/assume_aligned.h" } - module auto_ptr { private header "__memory/auto_ptr.h" } - module builtin_new_allocator { private header "__memory/builtin_new_allocator.h" } - module compressed_pair { private header "__memory/compressed_pair.h" } - module concepts { - private header "__memory/concepts.h" - export type_traits.remove_reference - } - module construct_at { private header "__memory/construct_at.h" } - module destruct_n { private header "__memory/destruct_n.h" } - module pointer_traits { private header "__memory/pointer_traits.h" } - module ranges_construct_at { private header "__memory/ranges_construct_at.h" } - module ranges_uninitialized_algorithms { - private header "__memory/ranges_uninitialized_algorithms.h" - export algorithm.__algorithm.in_out_result - } - module raw_storage_iterator { private header "__memory/raw_storage_iterator.h" } - module shared_ptr { private header "__memory/shared_ptr.h" } - module swap_allocator { private header "__memory/swap_allocator.h" } - module temp_value { private header "__memory/temp_value.h" } - module temporary_buffer { private header "__memory/temporary_buffer.h" } - module uninitialized_algorithms { private header "__memory/uninitialized_algorithms.h" } - module unique_ptr { private header "__memory/unique_ptr.h" } - module uses_allocator { private header "__memory/uses_allocator.h" } - module uses_allocator_construction { private header "__memory/uses_allocator_construction.h" } - module voidify { private header "__memory/voidify.h" } - } - } module memory_resource { - header "memory_resource" - export * - - module __memory_resource { - module memory_resource { private header "__memory_resource/memory_resource.h" } - module memory_resource_fwd { private header "__fwd/memory_resource.h" } - module monotonic_buffer_resource { private header "__memory_resource/monotonic_buffer_resource.h" } - module polymorphic_allocator { private header "__memory_resource/polymorphic_allocator.h" } - module pool_options { private header "__memory_resource/pool_options.h" } - module synchronized_pool_resource { private header "__memory_resource/synchronized_pool_resource.h" } - module unsynchronized_pool_resource { private header "__memory_resource/unsynchronized_pool_resource.h" } - } - } - module mutex { - @requires_LIBCXX_ENABLE_THREADS@ - header "mutex" - export * - - module __mutex { - module lock_guard { private header "__mutex/lock_guard.h" } - module mutex { private header "__mutex/mutex.h" } - module tag_types { private header "__mutex/tag_types.h" } - module unique_lock { private header "__mutex/unique_lock.h" } - } - } - module new { - header "new" - export * - } - module numbers { - header "numbers" + header "experimental/memory_resource" export * } - module numeric { - header "numeric" - export * - - module __numeric { - module accumulate { private header "__numeric/accumulate.h" } - module adjacent_difference { private header "__numeric/adjacent_difference.h" } - module exclusive_scan { private header "__numeric/exclusive_scan.h" } - module gcd_lcm { private header "__numeric/gcd_lcm.h" } - module inclusive_scan { private header "__numeric/inclusive_scan.h" } - module inner_product { private header "__numeric/inner_product.h" } - module iota { private header "__numeric/iota.h" } - module midpoint { private header "__numeric/midpoint.h" } - module partial_sum { private header "__numeric/partial_sum.h" } - module reduce { private header "__numeric/reduce.h" } - module transform_exclusive_scan { private header "__numeric/transform_exclusive_scan.h" } - module transform_inclusive_scan { private header "__numeric/transform_inclusive_scan.h" } - module transform_reduce { private header "__numeric/transform_reduce.h" } - } - } - module optional { - header "optional" - export * - } - module ostream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "ostream" - // FIXME: should re-export ios, streambuf? - export * - } - module queue { - header "queue" - export initializer_list - export * - } - module random { - header "random" - export initializer_list - export * - - module __random { - module bernoulli_distribution { private header "__random/bernoulli_distribution.h" } - module binomial_distribution { private header "__random/binomial_distribution.h" } - module cauchy_distribution { private header "__random/cauchy_distribution.h" } - module chi_squared_distribution { private header "__random/chi_squared_distribution.h" } - module clamp_to_integral { private header "__random/clamp_to_integral.h" } - module default_random_engine { private header "__random/default_random_engine.h" } - module discard_block_engine { private header "__random/discard_block_engine.h" } - module discrete_distribution { - private header "__random/discrete_distribution.h" - export vector - } - module exponential_distribution { private header "__random/exponential_distribution.h" } - module extreme_value_distribution { private header "__random/extreme_value_distribution.h" } - module fisher_f_distribution { private header "__random/fisher_f_distribution.h" } - module gamma_distribution { private header "__random/gamma_distribution.h" } - module generate_canonical { private header "__random/generate_canonical.h" } - module geometric_distribution { private header "__random/geometric_distribution.h" } - module independent_bits_engine { private header "__random/independent_bits_engine.h" } - module is_seed_sequence { private header "__random/is_seed_sequence.h" } - module is_valid { private header "__random/is_valid.h" } - module knuth_b { private header "__random/knuth_b.h" } - module linear_congruential_engine { private header "__random/linear_congruential_engine.h" } - module log2 { private header "__random/log2.h" } - module lognormal_distribution { private header "__random/lognormal_distribution.h" } - module mersenne_twister_engine { private header "__random/mersenne_twister_engine.h" } - module negative_binomial_distribution { private header "__random/negative_binomial_distribution.h" } - module normal_distribution { private header "__random/normal_distribution.h" } - module piecewise_constant_distribution { - private header "__random/piecewise_constant_distribution.h" - export vector - } - module piecewise_linear_distribution { - private header "__random/piecewise_linear_distribution.h" - export vector - } - module poisson_distribution { private header "__random/poisson_distribution.h" } - module random_device { private header "__random/random_device.h" } - module ranlux { private header "__random/ranlux.h" } - module seed_seq { private header "__random/seed_seq.h" } - module shuffle_order_engine { private header "__random/shuffle_order_engine.h" } - module student_t_distribution { private header "__random/student_t_distribution.h" } - module subtract_with_carry_engine { private header "__random/subtract_with_carry_engine.h" } - module uniform_int_distribution { private header "__random/uniform_int_distribution.h" } - module uniform_random_bit_generator { private header "__random/uniform_random_bit_generator.h" } - module uniform_real_distribution { private header "__random/uniform_real_distribution.h" } - module weibull_distribution { private header "__random/weibull_distribution.h" } - } - } - module ranges { - header "ranges" - export compare - export initializer_list - export iterator - export * - - module __ranges { - module access { private header "__ranges/access.h" } - module all { - private header "__ranges/all.h" - export functional.__functional.compose - export functional.__functional.perfect_forward - } - module as_rvalue_view { private header "__ranges/as_rvalue_view.h" } - module common_view { private header "__ranges/common_view.h" } - module concepts { private header "__ranges/concepts.h" } - module container_compatible_range { private header "__ranges/container_compatible_range.h" } - module copyable_box { private header "__ranges/copyable_box.h" } - module counted { - private header "__ranges/counted.h" - export span - } - module dangling { private header "__ranges/dangling.h" } - module data { private header "__ranges/data.h" } - module drop_view { private header "__ranges/drop_view.h" } - module drop_while_view { private header "__ranges/drop_while_view.h" } - module elements_view { private header "__ranges/elements_view.h" } - module empty { private header "__ranges/empty.h" } - module empty_view { private header "__ranges/empty_view.h" } - module enable_borrowed_range { private header "__ranges/enable_borrowed_range.h" } - module enable_view { private header "__ranges/enable_view.h" } - module filter_view { private header "__ranges/filter_view.h" } - module from_range { private header "__ranges/from_range.h" } - module iota_view { private header "__ranges/iota_view.h" } - module istream_view { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - private header "__ranges/istream_view.h" - } - module join_view { private header "__ranges/join_view.h" } - module lazy_split_view { private header "__ranges/lazy_split_view.h" } - module non_propagating_cache { private header "__ranges/non_propagating_cache.h" } - module owning_view { private header "__ranges/owning_view.h" } - module range_adaptor { private header "__ranges/range_adaptor.h" } - module rbegin { private header "__ranges/rbegin.h" } - module ref_view { private header "__ranges/ref_view.h" } - module rend { private header "__ranges/rend.h" } - module reverse_view { private header "__ranges/reverse_view.h" } - module single_view { private header "__ranges/single_view.h" } - module size { private header "__ranges/size.h" } - module split_view { private header "__ranges/split_view.h" } - module subrange { - private header "__ranges/subrange.h" - export subrange_fwd - } - module subrange_fwd { private header "__fwd/subrange.h" } - module take_view { private header "__ranges/take_view.h" } - module take_while_view { private header "__ranges/take_while_view.h" } - module transform_view { - private header "__ranges/transform_view.h" - export functional.__functional.bind_back - export functional.__functional.perfect_forward - } - module view_interface { private header "__ranges/view_interface.h" } - module views { private header "__ranges/views.h" } - module zip_view { private header "__ranges/zip_view.h" } - } - } - module ratio { - header "ratio" + module propagate_const { + header "experimental/propagate_const" export * } module regex { @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "regex" - export initializer_list + header "experimental/regex" export * } - module scoped_allocator { - header "scoped_allocator" - export * - } - module semaphore { - @requires_LIBCXX_ENABLE_THREADS@ - header "semaphore" + module simd { + header "experimental/simd" export * } module set { - header "set" - export initializer_list - export * - } - module shared_mutex { - @requires_LIBCXX_ENABLE_THREADS@ - header "shared_mutex" - export version - } - module source_location { - header "source_location" - export * - } - module span { - header "span" - export ranges.__ranges.enable_borrowed_range - export version - module span_fwd { private header "__fwd/span.h" } - } - module sstream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "sstream" - // FIXME: should re-export istream, ostream, ios, streambuf, string? - export * - } - module stack { - header "stack" - export initializer_list - export * - } - module stdexcept { - header "stdexcept" - export * - } - module streambuf { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "streambuf" + header "experimental/set" export * } module string { - header "string" - export initializer_list - export string_view - module __string { - module char_traits { private header "__string/char_traits.h" } - module constexpr_c_functions { private header "__string/constexpr_c_functions.h" } - module extern_template_lists { private header "__string/extern_template_lists.h" } - module string_fwd { private header "__fwd/string.h" } - } + header "experimental/string" export * } - module string_view { - header "string_view" - export initializer_list - export * - module string_view_fwd { private header "__fwd/string_view.h" } - } - module strstream { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "strstream" - export * - } - module system_error { - header "system_error" - export __errc - export * - module __system_error { - module errc { private header "__system_error/errc.h" } - module error_category { private header "__system_error/error_category.h" } - module error_code { - private header "__system_error/error_code.h" - export functional.__functional.hash - export functional.__functional.unary_function - } - module error_condition { - private header "__system_error/error_condition.h" - export functional.__functional.hash - export functional.__functional.unary_function - } - module system_error { private header "__system_error/system_error.h" } - - } - } - module thread { - @requires_LIBCXX_ENABLE_THREADS@ - header "thread" - export * - - module __thread { - module poll_with_backoff { private header "__thread/poll_with_backoff.h" } - module timed_backoff_policy { private header "__thread/timed_backoff_policy.h" } - } - } - module tuple { - header "tuple" - export * - - module get_fwd { private header "__fwd/get.h" } - module make_tuple_types { private header "__tuple/make_tuple_types.h" } - module pair_like { private header "__tuple/pair_like.h" } - module sfinae_helpers { private header "__tuple/sfinae_helpers.h" } - module tuple_element { private header "__tuple/tuple_element.h" } - module tuple_fwd { private header "__fwd/tuple.h" } - module tuple_indices { private header "__tuple/tuple_indices.h" } - module tuple_like { private header "__tuple/tuple_like.h" } - module tuple_like_ext { private header "__tuple/tuple_like_ext.h" } - module tuple_size { private header "__tuple/tuple_size.h" } - module tuple_types { private header "__tuple/tuple_types.h" } - } module type_traits { - header "type_traits" - export * - - module add_const { private header "__type_traits/add_const.h" } - module add_cv { private header "__type_traits/add_cv.h" } - module add_lvalue_reference { private header "__type_traits/add_lvalue_reference.h" } - module add_pointer { private header "__type_traits/add_pointer.h" } - module add_rvalue_reference { private header "__type_traits/add_rvalue_reference.h" } - module add_volatile { private header "__type_traits/add_volatile.h" } - module aligned_storage { private header "__type_traits/aligned_storage.h" } - module aligned_union { private header "__type_traits/aligned_union.h" } - module alignment_of { private header "__type_traits/alignment_of.h" } - module apply_cv { private header "__type_traits/apply_cv.h" } - module can_extract_key { private header "__type_traits/can_extract_key.h" } - module common_reference { private header "__type_traits/common_reference.h" } - module common_type { private header "__type_traits/common_type.h" } - module conditional { private header "__type_traits/conditional.h" } - module conjunction { private header "__type_traits/conjunction.h" } - module copy_cv { private header "__type_traits/copy_cv.h" } - module copy_cvref { private header "__type_traits/copy_cvref.h" } - module decay { private header "__type_traits/decay.h" } - module dependent_type { private header "__type_traits/dependent_type.h" } - module disjunction { private header "__type_traits/disjunction.h" } - module enable_if { private header "__type_traits/enable_if.h" } - module extent { private header "__type_traits/extent.h" } - module has_unique_object_representation { private header "__type_traits/has_unique_object_representation.h" } - module has_virtual_destructor { private header "__type_traits/has_virtual_destructor.h" } - module integral_constant { private header "__type_traits/integral_constant.h" } - module is_abstract { private header "__type_traits/is_abstract.h" } - module is_aggregate { private header "__type_traits/is_aggregate.h" } - module is_allocator { private header "__type_traits/is_allocator.h" } - module is_always_bitcastable { private header "__type_traits/is_always_bitcastable.h" } - module is_arithmetic { - private header "__type_traits/is_arithmetic.h" - export integral_constant - } - module is_array { - private header "__type_traits/is_array.h" - export integral_constant - } - module is_assignable { private header "__type_traits/is_assignable.h" } - module is_base_of { private header "__type_traits/is_base_of.h" } - module is_bounded_array { private header "__type_traits/is_bounded_array.h" } - module is_callable { private header "__type_traits/is_callable.h" } - module is_char_like_type { private header "__type_traits/is_char_like_type.h" } - module is_class { private header "__type_traits/is_class.h" } - module is_compound { private header "__type_traits/is_compound.h" } - module is_const { private header "__type_traits/is_const.h" } - module is_constant_evaluated { private header "__type_traits/is_constant_evaluated.h" } - module is_constructible { private header "__type_traits/is_constructible.h" } - module is_convertible { private header "__type_traits/is_convertible.h" } - module is_copy_assignable { private header "__type_traits/is_copy_assignable.h" } - module is_copy_constructible { private header "__type_traits/is_copy_constructible.h" } - module is_core_convertible { - private header "__type_traits/is_core_convertible.h" - export integral_constant - } - module is_default_constructible { private header "__type_traits/is_default_constructible.h" } - module is_destructible { private header "__type_traits/is_destructible.h" } - module is_empty { private header "__type_traits/is_empty.h" } - module is_enum { - private header "__type_traits/is_enum.h" - export integral_constant - } - module is_equality_comparable { - private header "__type_traits/is_equality_comparable.h" - export integral_constant - } - module is_execution_policy { private header "__type_traits/is_execution_policy.h" } - module is_final { private header "__type_traits/is_final.h" } - module is_floating_point { private header "__type_traits/is_floating_point.h" } - module is_function { private header "__type_traits/is_function.h" } - module is_fundamental { private header "__type_traits/is_fundamental.h" } - module is_implicitly_default_constructible { private header "__type_traits/is_implicitly_default_constructible.h" } - module is_integral { private header "__type_traits/is_integral.h" } - module is_literal_type { private header "__type_traits/is_literal_type.h" } - module is_member_function_pointer { private header "__type_traits/is_member_function_pointer.h" } - module is_member_object_pointer { private header "__type_traits/is_member_object_pointer.h" } - module is_member_pointer { private header "__type_traits/is_member_pointer.h" } - module is_move_assignable { private header "__type_traits/is_move_assignable.h" } - module is_move_constructible { private header "__type_traits/is_move_constructible.h" } - module is_nothrow_assignable { private header "__type_traits/is_nothrow_assignable.h" } - module is_nothrow_constructible { private header "__type_traits/is_nothrow_constructible.h" } - module is_nothrow_convertible { private header "__type_traits/is_nothrow_convertible.h" } - module is_nothrow_copy_assignable { private header "__type_traits/is_nothrow_copy_assignable.h" } - module is_nothrow_copy_constructible { private header "__type_traits/is_nothrow_copy_constructible.h" } - module is_nothrow_default_constructible { private header "__type_traits/is_nothrow_default_constructible.h" } - module is_nothrow_destructible { private header "__type_traits/is_nothrow_destructible.h" } - module is_nothrow_move_assignable { private header "__type_traits/is_nothrow_move_assignable.h" } - module is_nothrow_move_constructible { private header "__type_traits/is_nothrow_move_constructible.h" } - module is_null_pointer { private header "__type_traits/is_null_pointer.h" } - module is_object { private header "__type_traits/is_object.h" } - module is_pod { private header "__type_traits/is_pod.h" } - module is_pointer { private header "__type_traits/is_pointer.h" } - module is_polymorphic { private header "__type_traits/is_polymorphic.h" } - module is_primary_template { private header "__type_traits/is_primary_template.h" } - module is_reference { private header "__type_traits/is_reference.h" } - module is_reference_wrapper { private header "__type_traits/is_reference_wrapper.h" } - module is_referenceable { private header "__type_traits/is_referenceable.h" } - module is_same { - private header "__type_traits/is_same.h" - export type_traits.integral_constant - } - module is_scalar { private header "__type_traits/is_scalar.h" } - module is_scoped_enum { private header "__type_traits/is_scoped_enum.h" } - module is_signed { private header "__type_traits/is_signed.h" } - module is_signed_integer { private header "__type_traits/is_signed_integer.h" } - module is_specialization { private header "__type_traits/is_specialization.h" } - module is_standard_layout { private header "__type_traits/is_standard_layout.h" } - module is_swappable { private header "__type_traits/is_swappable.h" } - module is_trivial { private header "__type_traits/is_trivial.h" } - module is_trivially_assignable { private header "__type_traits/is_trivially_assignable.h" } - module is_trivially_constructible { private header "__type_traits/is_trivially_constructible.h" } - module is_trivially_copy_assignable { private header "__type_traits/is_trivially_copy_assignable.h" } - module is_trivially_copy_constructible { private header "__type_traits/is_trivially_copy_constructible.h" } - module is_trivially_copyable { private header "__type_traits/is_trivially_copyable.h" } - module is_trivially_default_constructible { private header "__type_traits/is_trivially_default_constructible.h" } - module is_trivially_destructible { private header "__type_traits/is_trivially_destructible.h" } - module is_trivially_lexicographically_comparable { private header "__type_traits/is_trivially_lexicographically_comparable.h" } - module is_trivially_move_assignable { private header "__type_traits/is_trivially_move_assignable.h" } - module is_trivially_move_constructible { private header "__type_traits/is_trivially_move_constructible.h" } - module is_unbounded_array { private header "__type_traits/is_unbounded_array.h" } - module is_union { private header "__type_traits/is_union.h" } - module is_unsigned { private header "__type_traits/is_unsigned.h" } - module is_unsigned_integer { private header "__type_traits/is_unsigned_integer.h" } - module is_valid_expansion { private header "__type_traits/is_valid_expansion.h" } - module is_void { - private header "__type_traits/is_void.h" - export integral_constant - } - module is_volatile { private header "__type_traits/is_volatile.h" } - module lazy { private header "__type_traits/lazy.h" } - module make_32_64_or_128_bit { private header "__type_traits/make_32_64_or_128_bit.h" } - module make_const_lvalue_ref { private header "__type_traits/make_const_lvalue_ref.h" } - module make_signed { private header "__type_traits/make_signed.h" } - module make_unsigned { private header "__type_traits/make_unsigned.h" } - module maybe_const { private header "__type_traits/maybe_const.h" } - module nat { private header "__type_traits/nat.h" } - module negation { private header "__type_traits/negation.h" } - module noexcept_move_assign_container { private header "__type_traits/noexcept_move_assign_container.h" } - module predicate_traits { private header "__type_traits/predicate_traits.h" } - module promote { private header "__type_traits/promote.h" } - module rank { private header "__type_traits/rank.h" } - module remove_all_extents { private header "__type_traits/remove_all_extents.h" } - module remove_const { private header "__type_traits/remove_const.h" } - module remove_const_ref { private header "__type_traits/remove_const_ref.h" } - module remove_cv { private header "__type_traits/remove_cv.h" } - module remove_cvref { private header "__type_traits/remove_cvref.h" } - module remove_extent { private header "__type_traits/remove_extent.h" } - module remove_pointer { private header "__type_traits/remove_pointer.h" } - module remove_reference { private header "__type_traits/remove_reference.h" } - module remove_volatile { private header "__type_traits/remove_volatile.h" } - module result_of { private header "__type_traits/result_of.h" } - module strip_signature { private header "__type_traits/strip_signature.h" } - module type_identity { private header "__type_traits/type_identity.h" } - module type_list { private header "__type_traits/type_list.h" } - module underlying_type { - private header "__type_traits/underlying_type.h" - - export type_traits - } - module unwrap_ref { private header "__type_traits/unwrap_ref.h" } - module void_t { private header "__type_traits/void_t.h" } - } - module typeindex { - header "typeindex" - export * - } - module typeinfo { - header "typeinfo" + header "experimental/type_traits" export * } module unordered_map { - header "unordered_map" - export initializer_list + header "experimental/unordered_map" export * } module unordered_set { - header "unordered_set" - export initializer_list + header "experimental/unordered_set" export * } module utility { - header "utility" - export initializer_list + header "experimental/utility" export * - - module __utility { - module as_const { private header "__utility/as_const.h" } - module auto_cast { - private header "__utility/auto_cast.h" - export type_traits.decay - } - module cmp { private header "__utility/cmp.h" } - module convert_to_integral { private header "__utility/convert_to_integral.h" } - module declval { private header "__utility/declval.h" } - module exception_guard { private header "__utility/exception_guard.h" } - module exchange { private header "__utility/exchange.h" } - module forward { private header "__utility/forward.h" } - module forward_like { private header "__utility/forward_like.h" } - module in_place { private header "__utility/in_place.h" } - module integer_sequence { private header "__utility/integer_sequence.h" } - module move { private header "__utility/move.h" } - module pair { private header "__utility/pair.h" } - module pair_fwd { private header "__fwd/pair.h" } - module piecewise_construct { private header "__utility/piecewise_construct.h" } - module priority_tag { private header "__utility/priority_tag.h" } - module rel_ops { private header "__utility/rel_ops.h" } - module swap { private header "__utility/swap.h" } - module terminate_on_exception { private header "__utility/terminate_on_exception.h" } - module to_underlying { private header "__utility/to_underlying.h" } - module unreachable { private header "__utility/unreachable.h" } - } - } - module valarray { - header "valarray" - export initializer_list - export * - } - module variant { - header "variant" - export * - - module __variant { - module monostate { private header "__variant/monostate.h" } - } } module vector { - header "vector" - export initializer_list + header "experimental/vector" export * } - module version { - header "version" + // FIXME these should be private + module __config { + header "experimental/__config" export * } - - // FIXME: These should be private. - module __assert { header "__assert" export * } - module __availability { private header "__availability" export * } - module __bit_reference { private header "__bit_reference" export * } - module __debug { header "__debug" export * } - module __hash_table { header "__hash_table" export * } - module __locale { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - private header "__locale" export * + module __memory { + header "experimental/__memory" + export * } - module __mbstate_t { private header "__mbstate_t.h" export * } - module __node_handle { private header "__node_handle" export * } - module __split_buffer { private header "__split_buffer" export * } - module __std_mbstate_t { private header "__std_mbstate_t.h" export * } - module __threading_support { header "__threading_support" export * } - module __tree { header "__tree" export * } - module __undef_macros { header "__undef_macros" export * } - module __verbose_abort { header "__verbose_abort" export * } - - module experimental { - requires cplusplus11 +} - module deque { - header "experimental/deque" - export * - } - module forward_list { - header "experimental/forward_list" - export * - } - module iterator { - header "experimental/iterator" - export * - } - module list { - header "experimental/list" - export * - } - module map { - header "experimental/map" - export * - } - module memory_resource { - header "experimental/memory_resource" - export * - } - module propagate_const { - header "experimental/propagate_const" - export * - } - module regex { - @requires_LIBCXX_ENABLE_LOCALIZATION@ - header "experimental/regex" - export * - } - module simd { - header "experimental/simd" - export * - } - module set { - header "experimental/set" - export * - } - module span { - header "span" - export * - } - module string { - header "experimental/string" - export * - } - module type_traits { - header "experimental/type_traits" - export * - } - module unordered_map { - header "experimental/unordered_map" - export * - } - module unordered_set { - header "experimental/unordered_set" - export * - } - module utility { - header "experimental/utility" - export * - } - module vector { - header "experimental/vector" - export * - } - // FIXME these should be private - module __memory { - header "experimental/__memory" - export * - } - } // end experimental +// C++ ABI +module std_cxxabi [system] { + header "cxxabi.h" } + +// Implementation detail headers that are private to libc++. These modules +// must not be directly imported. diff --git a/libcxx/include/private_header_module_attributes.json.in b/libcxx/include/private_header_module_attributes.json.in new file mode 100644 --- /dev/null +++ b/libcxx/include/private_header_module_attributes.json.in @@ -0,0 +1,655 @@ +{ + "__assert": { + "exports": [ + "*" + ] + }, + "__availability": { + "exports": [ + "*" + ] + }, + "__bit_reference": { + "exports": [ + "*" + ] + }, + "__config": { + "textual": true + }, + "__config_site": { + "textual": true + }, + "__cxxabi_config.h": { + "module_directory": "cxxabi" + }, + "__debug": { + "exports": [ + "*" + ] + }, + "__hash_table": { + "exports": [ + "*" + ] + }, + "__locale": { + "exports": [ + "*" + ], + "requires": [ + @requires_LIBCXX_ENABLE_LOCALIZATION@ + ] + }, + "__mbstate_t.h": { + "exports": [ + "*" + ] + }, + "__node_handle": { + "exports": [ + "*" + ] + }, + "__split_buffer": { + "exports": [ + "*" + ] + }, + "__std_mbstate_t.h": { + "exports": [ + "*" + ] + }, + "__threading_support": { + "exports": [ + "*" + ] + }, + "__tree": { + "exports": [ + "*" + ] + }, + "__undef_macros": { + "exports": [ + "*" + ], + "textual": true + }, + "__verbose_abort": { + "exports": [ + "*" + ] + }, + "__algorithm/iterator_operations.h": { + "exports": [ + "*" + ] + }, + "__algorithm/minmax.h": { + "exports": [ + "*" + ] + }, + "__algorithm/pstl_backend.h": { + "exports": [ + "__algorithm/pstl_backends/cpu_backend.h", + "__algorithm/pstl_backends/cpu_backends/backend.h" + ] + }, + "__algorithm/pstl_backends/cpu_backend.h": { + "exports": [ + "*" + ] + }, + "__algorithm/pstl_backends/cpu_backends/backend.h": { + "exports": [ + "*" + ] + }, + "__algorithm/ranges_binary_search.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_clamp.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_copy_backward.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_copy_if.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_copy_n.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_equal_range.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_for_each.h": { + "exports": [ + "__algorithm/in_fun_result.h" + ] + }, + "__algorithm/ranges_for_each_n.h": { + "exports": [ + "__algorithm/in_fun_result.h" + ] + }, + "__algorithm/ranges_includes.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_inplace_merge.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_is_heap.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_is_heap_until.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_is_sorted.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_is_sorted_until.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_lexicographical_compare.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_lower_bound.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_make_heap.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_max.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_max_element.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_merge.h": { + "exports": [ + "__algorithm/in_in_out_result.h" + ] + }, + "__algorithm/ranges_min.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_min_element.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_minmax.h": { + "exports": [ + "__functional/ranges_operations.h", + "__algorithm/min_max_result.h" + ] + }, + "__algorithm/ranges_minmax_element.h": { + "exports": [ + "__functional/ranges_operations.h", + "__algorithm/min_max_result.h" + ] + }, + "__algorithm/ranges_mismatch.h": { + "exports": [ + "__algorithm/in_in_result.h" + ] + }, + "__algorithm/ranges_move.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_move_backward.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_next_permutation.h": { + "exports": [ + "__algorithm/in_found_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_nth_element.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_partial_sort.h": { + "exports": [ + "__algorithm/in_out_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_partial_sort_copy.h": { + "exports": [ + "__algorithm/in_out_out_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_pop_heap.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_prev_permutation.h": { + "exports": [ + "__algorithm/in_found_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_push_heap.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_remove_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_remove_copy_if.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_replace_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_replace_copy_if.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_reverse_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_rotate_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_set_difference.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_set_intersection.h": { + "exports": [ + "__algorithm/in_in_out_result.h" + ] + }, + "__algorithm/ranges_set_symmetric_difference.h": { + "exports": [ + "__algorithm/in_in_out_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_set_union.h": { + "exports": [ + "__algorithm/in_in_out_result.h", + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_sort.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_sort_heap.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_stable_sort.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/ranges_swap_ranges.h": { + "exports": [ + "__algorithm/in_in_result.h" + ] + }, + "__algorithm/ranges_transform.h": { + "exports": [ + "__algorithm/in_in_out_result.h", + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_unique_copy.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__algorithm/ranges_upper_bound.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__algorithm/unwrap_range.h": { + "exports": [ + "__utility/pair.h" + ] + }, + "__atomic/atomic.h": { + "exports": [ + "__atomic/atomic_base.h" + ] + }, + "__chrono/formatter.h": { + "requires": [ + "@requires_LIBCXX_ENABLE_LOCALIZATION@" + ] + }, + "__chrono/high_resolution_clock.h": { + "exports": [ + "__chrono/steady_clock.h", + "__chrono/system_clock.h", + "__chrono/time_point.h" + ] + }, + "__chrono/ostream.h": { + "requires": [ + "@requires_LIBCXX_ENABLE_LOCALIZATION@" + ] + }, + "__chrono/parser_std_format_spec.h": { + "requires": [ + "@requires_LIBCXX_ENABLE_LOCALIZATION@" + ] + }, + "__concepts/equality_comparable.h": { + "exports": [ + "__type_traits/common_reference.h" + ] + }, + "__concepts/same_as.h": { + "exports": [ + "__type_traits/is_same.h" + ] + }, + "__filesystem/path.h": { + "exports": [ + "__functional/hash.h", + "__functional/unary_function.h" + ] + }, + "__format/format_context.h": { + "exports": [ + "std_optional", + "std_locale", + "__locale" + ] + }, + "__format/format_functions.h": { + "exports": [ + "std_string" + ] + }, + "__format/format_to_n_result.h": { + "exports": [ + "__iterator/incrementable_traits.h" + ] + }, + "__fwd/array.h": { + "module_directory": "__array", + "submodule_name": "array_fwd" + }, + "__fwd/fstream.h": { + "module_directory": "__iosfwd", + "submodule_name": "fstream_fwd" + }, + "__fwd/get.h": { + "module_directory": "__tuple", + "submodule_name": "get_fwd" + }, + "__fwd/hash.h": { + "module_directory": "__functional", + "submodule_name": "hash_fwd" + }, + "__fwd/ios.h": { + "module_directory": "__iosfwd", + "submodule_name": "ios_fwd" + }, + "__fwd/istream.h": { + "module_directory": "__iosfwd", + "submodule_name": "istream_fwd" + }, + "__fwd/memory_resource.h": { + "module_directory": "__memory_resource", + "submodule_name": "memory_resource_fwd" + }, + "__fwd/ostream.h": { + "module_directory": "__iosfwd", + "submodule_name": "ostream_fwd" + }, + "__fwd/pair.h": { + "module_directory": "__utility", + "submodule_name": "pair_fwd" + }, + "__fwd/span.h": { + "module_directory": "__span", + "submodule_name": "span_fwd" + }, + "__fwd/sstream.h": { + "module_directory": "__iosfwd", + "submodule_name": "sstream_fwd" + }, + "__fwd/streambuf.h": { + "module_directory": "__iosfwd", + "submodule_name": "streambuf_fwd" + }, + "__fwd/string.h": { + "module_directory": "__string", + "submodule_name": "string_fwd" + }, + "__fwd/string_view.h": { + "module_directory": "__string_view", + "submodule_name": "string_view_fwd" + }, + "__fwd/subrange.h": { + "module_directory": "__ranges", + "submodule_name": "subrange_fwd" + }, + "__fwd/tuple.h": { + "module_directory": "__tuple", + "submodule_name": "tuple_fwd" + }, + "__functional/invoke.h": { + "exports": [ + "std_type_traits" + ] + }, + "__iterator/concepts.h": { + "exports": [ + "__concepts/equality_comparable.h", + "__type_traits/common_reference.h" + ] + }, + "__iterator/mergeable.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__iterator/ostreambuf_iterator.h": { + "exports": [ + "std_iosfwd" + ] + }, + "__iterator/readable_traits.h": { + "exports": [ + "__iterator/iterator_traits.h" + ] + }, + "__iterator/sortable.h": { + "exports": [ + "__functional/ranges_operations.h" + ] + }, + "__locale_dir/locale_base_api/bsd_locale_defaults.h": { + "textual": true + }, + "__locale_dir/locale_base_api/bsd_locale_fallbacks.h": { + "textual": true + }, + "__memory/concepts.h": { + "exports": [ + "__type_traits/remove_reference.h" + ] + }, + "__memory/ranges_uninitialized_algorithms.h": { + "exports": [ + "__algorithm/in_out_result.h" + ] + }, + "__random/discrete_distribution.h": { + "exports": [ + "std_vector" + ] + }, + "__random/piecewise_constant_distribution.h": { + "exports": [ + "std_vector" + ] + }, + "__random/piecewise_linear_distribution.h": { + "exports": [ + "std_vector" + ] + }, + "__ranges/all.h": { + "exports": [ + "__functional/compose.h", + "__functional/perfect_forward.h" + ] + }, + "__ranges/counted.h": { + "exports": [ + "std_span" + ] + }, + "__ranges/istream_view.h": { + "requires": [ + "@requires_LIBCXX_ENABLE_LOCALIZATION@" + ] + }, + "__ranges/subrange.h": { + "exports": [ + "__fwd/subrange.h" + ] + }, + "__ranges/transform_view.h": { + "exports": [ + "__functional/bind_back.h", + "__functional/perfect_forward.h" + ] + }, + "__system_error/error_code.h": { + "exports": [ + "__functional/hash.h", + "__functional/unary_function.h" + ] + }, + "__system_error/error_condition.h": { + "exports": [ + "__functional/hash.h", + "__functional/unary_function.h" + ] + }, + "__type_traits/is_arithmetic.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_array.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_core_convertible.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_enum.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_equality_comparable.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_same.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/is_void.h": { + "exports": [ + "__type_traits/integral_constant.h" + ] + }, + "__type_traits/underlying_type.h": { + "exports": [ + "std_type_traits" + ] + }, + "__utility/auto_cast.h": { + "exports": [ + "__type_traits/decay.h" + ] + } +} diff --git a/libcxx/include/set b/libcxx/include/set --- a/libcxx/include/set +++ b/libcxx/include/set @@ -485,6 +485,7 @@ #include <__node_handle> #include <__tree> #include <__type_traits/is_allocator.h> +#include <__type_traits/type_identity.h> #include <__utility/forward.h> #include diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -109,6 +109,8 @@ #include <__thread/poll_with_backoff.h> #include <__thread/timed_backoff_policy.h> #include <__threading_support> +#include <__type_traits/decay.h> +#include <__type_traits/is_pointer.h> #include <__utility/forward.h> #include #include diff --git a/libcxx/include/tuple b/libcxx/include/tuple --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -207,6 +207,7 @@ #include <__config> #include <__functional/invoke.h> #include <__fwd/array.h> +#include <__fwd/get.h> #include <__fwd/tuple.h> #include <__memory/allocator_arg_t.h> #include <__memory/uses_allocator.h> diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -474,6 +474,7 @@ #include <__memory_resource/polymorphic_allocator.h> #include <__node_handle> #include <__type_traits/is_allocator.h> +#include <__type_traits/type_identity.h> #include <__utility/forward.h> #include diff --git a/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp b/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp --- a/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp +++ b/libcxx/test/libcxx/algorithms/alg.sorting/assert.sort.invalid_comparator.pass.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "check_assertion.h" diff --git a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp --- a/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp +++ b/libcxx/test/libcxx/containers/unord/next_pow2.pass.cpp @@ -21,6 +21,8 @@ #include <__hash_table> #include #include +#include +#include #include "test_macros.h" diff --git a/libcxx/test/libcxx/lint/lint_headers.sh.py b/libcxx/test/libcxx/lint/lint_headers.sh.py --- a/libcxx/test/libcxx/lint/lint_headers.sh.py +++ b/libcxx/test/libcxx/lint/lint_headers.sh.py @@ -10,6 +10,8 @@ def exclude_from_consideration(path): return ( + path.endswith('.json.in') or + path.endswith('.py') or path.endswith('.txt') or path.endswith('.modulemap.in') or os.path.basename(path) == '__config' or diff --git a/libcxx/test/libcxx/lint/lint_modulemap.sh.py b/libcxx/test/libcxx/lint/lint_modulemap.sh.py deleted file mode 100755 --- a/libcxx/test/libcxx/lint/lint_modulemap.sh.py +++ /dev/null @@ -1,48 +0,0 @@ -# RUN: %{python} %s - -# Verify that each list of private submodules in libcxx/include/module.modulemap.in -# is maintained in alphabetical order. - -import os -import re - - -if __name__ == '__main__': - libcxx_test_libcxx_lint = os.path.dirname(os.path.abspath(__file__)) - libcxx = os.path.abspath(os.path.join(libcxx_test_libcxx_lint, '../../..')) - modulemap_name = os.path.join(libcxx, 'include/module.modulemap.in') - assert os.path.isfile(modulemap_name) - - okay = True - prevline = None - with open(modulemap_name, 'r') as f: - for line in f.readlines(): - if re.match(r'^\s*module.*[{]\s*private', line): - # Check that these lines are all of the expected format. - # This incidentally checks for typos in the module name. - if re.match(r'^\s*module (\w+)\s+[{] private header "\1(.h)?"\s+export [*] [}]', line): - # It's a top-level private header, such as <__bit_reference>. - pass - elif re.match(r'^\s*module (\w+)\s+[{] private (textual )?header "__(\w+/)*\1[.]h" [}]', line): - # It's a private submodule, such as <__utility/swap.h>. - pass - elif re.match(r'^\s*module (\w+)_fwd\s+[{] private header "__fwd/\1[.]h" [}]', line): - # It's a private submodule with forward declarations, such as <__fwd/span.h>. - pass - elif re.match(r'^\s*module (?:\w+_)*(\w+)\s+[{] private (textual )?header "__(\w+/)*\1[.]h" [}]', line): - # It's a private pstl submodule, such as <__algorithm/pstl_backends/cpu_backend.h> - pass - else: - okay = False - print("LINE DOESN'T MATCH REGEX in libcxx/include/module.modulemap.in!") - print(line) - # Check that these lines are alphabetized. - if (prevline is not None) and (line < prevline): - okay = False - print('LINES OUT OF ORDER in libcxx/include/module.modulemap.in!') - print(prevline) - print(line) - prevline = line - else: - prevline = None - assert okay diff --git a/libcxx/utils/generate_header_tests.py b/libcxx/utils/generate_header_tests.py --- a/libcxx/utils/generate_header_tests.py +++ b/libcxx/utils/generate_header_tests.py @@ -115,7 +115,8 @@ def is_header(file): """Returns whether the given file is a header (i.e. not a directory or the modulemap file).""" - return not file.is_dir() and not file.name == 'module.modulemap.in' and file.name != 'libcxx.imp' + return (not file.is_dir() and file.name != 'module.modulemap.in' and file.name != 'private_header_module_attributes.json.in' + and file.name != 'generate_module_map.py' and file.name != 'libcxx.imp') def main():