diff --git a/libcxx/modules/CMakeLists.txt b/libcxx/modules/CMakeLists.txt --- a/libcxx/modules/CMakeLists.txt +++ b/libcxx/modules/CMakeLists.txt @@ -5,120 +5,117 @@ # The headers of Table 24: C++ library headers [tab:headers.cpp] # and the headers of Table 25: C++ headers for C library facilities [tab:headers.cpp.c] -set(LIBCXX_SOURCES_MODULE_STD - std.cppm - std/algorithm.cppm - std/any.cppm - std/array.cppm - std/atomic.cppm - std/barrier.cppm - std/bit.cppm - std/bitset.cppm - std/cassert.cppm - std/cctype.cppm - std/cerrno.cppm - std/cfenv.cppm - std/cfloat.cppm - std/charconv.cppm - std/chrono.cppm - std/cinttypes.cppm - std/climits.cppm - std/clocale.cppm - std/cmath.cppm - std/codecvt.cppm - std/compare.cppm - std/complex.cppm - std/concepts.cppm - std/condition_variable.cppm - std/coroutine.cppm - std/csetjmp.cppm - std/csignal.cppm - std/cstdarg.cppm - std/cstddef.cppm - std/cstdint.cppm - std/cstdio.cppm - std/cstdlib.cppm - std/cstring.cppm - std/ctime.cppm - std/cuchar.cppm - std/cwchar.cppm - std/cwctype.cppm - std/deque.cppm - std/exception.cppm - std/execution.cppm - std/expected.cppm - std/filesystem.cppm - std/flat_map.cppm - std/flat_set.cppm - std/format.cppm - std/forward_list.cppm - std/fstream.cppm - std/functional.cppm - std/future.cppm - std/generator.cppm - std/hazard_pointer.cppm - std/initializer_list.cppm - std/iomanip.cppm - std/ios.cppm - std/iosfwd.cppm - std/iostream.cppm - std/iostream.cppm - std/istream.cppm - std/iterator.cppm - std/latch.cppm - std/limits.cppm - std/list.cppm - std/locale.cppm - std/map.cppm - std/mdspan.cppm - std/memory.cppm - std/memory_resource.cppm - std/mutex.cppm - std/new.cppm - std/numbers.cppm - std/numeric.cppm - std/optional.cppm - std/ostream.cppm - std/print.cppm - std/queue.cppm - std/random.cppm - std/ranges.cppm - std/ratio.cppm - std/rcu.cppm - std/regex.cppm - std/scoped_allocator.cppm - std/semaphore.cppm - std/set.cppm - std/shared_mutex.cppm - std/source_location.cppm - std/span.cppm - std/spanstream.cppm - std/sstream.cppm - std/stack.cppm - std/stacktrace.cppm - std/stdexcept.cppm - std/stdexcept.cppm - std/stdfloat.cppm - std/stop_token.cppm - std/streambuf.cppm - std/string.cppm - std/string_view.cppm - std/strstream.cppm - std/syncstream.cppm - std/system_error.cppm - std/text_encoding.cppm - std/thread.cppm - std/tuple.cppm - std/type_traits.cppm - std/typeindex.cppm - std/typeinfo.cppm - std/unordered_map.cppm - std/unordered_set.cppm - std/utility.cppm - std/valarray.cppm - std/variant.cppm - std/vector.cppm - std/version.cppm +set(LIBCXX_MODULE_STD_SOURCES + std/algorithm.inc + std/any.inc + std/array.inc + std/atomic.inc + std/barrier.inc + std/bit.inc + std/bitset.inc + std/cassert.inc + std/cctype.inc + std/cerrno.inc + std/cfenv.inc + std/cfloat.inc + std/charconv.inc + std/chrono.inc + std/cinttypes.inc + std/climits.inc + std/clocale.inc + std/cmath.inc + std/codecvt.inc + std/compare.inc + std/complex.inc + std/concepts.inc + std/condition_variable.inc + std/coroutine.inc + std/csetjmp.inc + std/csignal.inc + std/cstdarg.inc + std/cstddef.inc + std/cstdint.inc + std/cstdio.inc + std/cstdlib.inc + std/cstring.inc + std/ctime.inc + std/cuchar.inc + std/cwchar.inc + std/cwctype.inc + std/deque.inc + std/exception.inc + std/execution.inc + std/expected.inc + std/filesystem.inc + std/flat_map.inc + std/flat_set.inc + std/format.inc + std/forward_list.inc + std/fstream.inc + std/functional.inc + std/future.inc + std/generator.inc + std/hazard_pointer.inc + std/initializer_list.inc + std/iomanip.inc + std/ios.inc + std/iosfwd.inc + std/iostream.inc + std/istream.inc + std/iterator.inc + std/latch.inc + std/limits.inc + std/list.inc + std/locale.inc + std/map.inc + std/mdspan.inc + std/memory.inc + std/memory_resource.inc + std/mutex.inc + std/new.inc + std/numbers.inc + std/numeric.inc + std/optional.inc + std/ostream.inc + std/print.inc + std/queue.inc + std/random.inc + std/ranges.inc + std/ratio.inc + std/rcu.inc + std/regex.inc + std/scoped_allocator.inc + std/semaphore.inc + std/set.inc + std/shared_mutex.inc + std/source_location.inc + std/span.inc + std/spanstream.inc + std/sstream.inc + std/stack.inc + std/stacktrace.inc + std/stdexcept.inc + std/stdfloat.inc + std/stop_token.inc + std/streambuf.inc + std/string.inc + std/string_view.inc + std/strstream.inc + std/syncstream.inc + std/system_error.inc + std/text_encoding.inc + std/thread.inc + std/tuple.inc + std/type_traits.inc + std/typeindex.inc + std/typeinfo.inc + std/unordered_map.inc + std/unordered_set.inc + std/utility.inc + std/valarray.inc + std/variant.inc + std/vector.inc + std/version.inc ) # TODO MODULES the CMakeLists.txt in the install directory is only temporary @@ -132,8 +129,24 @@ @ONLY ) -set(_all_modules "${LIBCXX_GENERATED_MODULE_DIR}/CMakeLists.txt") -foreach(file ${LIBCXX_SOURCES_MODULE_STD}) +set(LIBCXX_MODULE_STD_INCLUDE_SOURCES) +foreach(file ${LIBCXX_MODULE_STD_SOURCES}) + set( + LIBCXX_MODULE_STD_INCLUDE_SOURCES + "${LIBCXX_MODULE_STD_INCLUDE_SOURCES}#include \"${file}\"\n" + ) +endforeach() + +configure_file( + "std.cppm.in" + "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm" + @ONLY +) + +set(_all_modules) +list(APPEND _all_modules "${LIBCXX_GENERATED_MODULE_DIR}/CMakeLists.txt") +list(APPEND _all_modules "${LIBCXX_GENERATED_MODULE_DIR}/std.cppm") +foreach(file ${LIBCXX_MODULE_STD_SOURCES}) set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}") set(dst "${LIBCXX_GENERATED_MODULE_DIR}/${file}") add_custom_command(OUTPUT ${dst} diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in --- a/libcxx/modules/CMakeLists.txt.in +++ b/libcxx/modules/CMakeLists.txt.in @@ -48,7 +48,7 @@ add_library(std) target_sources(std PUBLIC FILE_SET cxx_modules TYPE CXX_MODULES FILES - @LIBCXX_SOURCES_MODULE_STD@ + std.cppm ) target_compile_definitions(std PRIVATE _LIBCPP_ENABLE_EXPERIMENTAL) diff --git a/libcxx/modules/README.md b/libcxx/modules/README.md new file mode 100644 --- /dev/null +++ b/libcxx/modules/README.md @@ -0,0 +1,21 @@ +# The "module partitions" for the std module + +The files in this directory contain the exported named declarations per header. +These files are used for the following purposes: + + - During testing exported named declarations are tested against the named + declarations in the associated header. This excludes reserved names; they + are not exported. + - Generate the module std. + +These use cases require including the required headers for these "partitions" +at different locations. This means the user of these "partitions" are +responsible for including the proper header and validating whether the header can +be loaded in the current libc++ configuration. For example "include " +fails when locales are not available. The "partitions" use the libc++ feature +macros to export the declarations available in the current configuration. This +configuration is available if the user includes the `__config' header. + +We use `.inc` files that we include from the top-level module instead of +using real C++ module partitions. This is a lot faster than module partitions, +see [this](https://discourse.llvm.org/t/alternatives-to-the-implementation-of-std-modules/71958) for details. diff --git a/libcxx/modules/std.cppm b/libcxx/modules/std.cppm deleted file mode 100644 --- a/libcxx/modules/std.cppm +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -export module std; - -// The headers of Table 24: C++ library headers [tab:headers.cpp] -// and the headers of Table 25: C++ headers for C library facilities [tab:headers.cpp.c] -export import :__new; // Note new is a keyword and not a valid identifier -export import :algorithm; -export import :any; -export import :array; -export import :atomic; -export import :barrier; -export import :bit; -export import :bitset; -export import :cassert; -export import :cctype; -export import :cerrno; -export import :cfenv; -export import :cfloat; -export import :charconv; -export import :chrono; -export import :cinttypes; -export import :climits; -export import :clocale; -export import :cmath; -export import :codecvt; -export import :compare; -export import :complex; -export import :concepts; -export import :condition_variable; -export import :coroutine; -export import :csetjmp; -export import :csignal; -export import :cstdarg; -export import :cstddef; -export import :cstdio; -export import :cstdlib; -export import :cstdint; -export import :cstring; -export import :ctime; -export import :cuchar; -export import :cwchar; -export import :cwctype; -export import :deque; -export import :exception; -export import :execution; -export import :expected; -export import :filesystem; -export import :flat_map; -export import :flat_set; -export import :format; -export import :forward_list; -export import :fstream; -export import :functional; -export import :future; -export import :generator; -export import :hazard_pointer; -export import :initializer_list; -export import :iomanip; -export import :ios; -export import :iosfwd; -export import :iostream; -export import :istream; -export import :iterator; -export import :latch; -export import :limits; -export import :list; -export import :locale; -export import :map; -export import :mdspan; -export import :memory; -export import :memory_resource; -export import :mutex; -export import :numbers; -export import :numeric; -export import :optional; -export import :ostream; -export import :print; -export import :queue; -export import :random; -export import :ranges; -export import :ratio; -export import :rcu; -export import :regex; -export import :scoped_allocator; -export import :semaphore; -export import :set; -export import :shared_mutex; -export import :source_location; -export import :span; -export import :spanstream; -export import :sstream; -export import :stack; -export import :stacktrace; -export import :stdexcept; -export import :stdfloat; -export import :stop_token; -export import :streambuf; -export import :string; -export import :string_view; -export import :strstream; -export import :syncstream; -export import :system_error; -export import :text_encoding; -export import :thread; -export import :tuple; -export import :type_traits; -export import :typeindex; -export import :typeinfo; -export import :unordered_map; -export import :unordered_set; -export import :utility; -export import :valarray; -export import :variant; -export import :vector; -export import :version; diff --git a/libcxx/modules/std.cppm.in b/libcxx/modules/std.cppm.in new file mode 100644 --- /dev/null +++ b/libcxx/modules/std.cppm.in @@ -0,0 +1,170 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +module; + +#include <__config> + +// TODO MODULES This could be generated + +// The headers of Table 24: C++ library headers [tab:headers.cpp] +// and the headers of Table 25: C++ headers for C library facilities [tab:headers.cpp.c] +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// *** Headers disabled by a feature *** + +#ifndef _LIBCPP_HAS_NO_LOCALIZATION +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // _LIBCPP_HAS_NO_LOCALIZATION +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +# include +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS + +// *** Headers not yet available *** +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() +#if __has_include() +# error "include unconditionally" +# include +#endif // __has_include() + +export module std; + +@LIBCXX_MODULE_STD_INCLUDE_SOURCES@ diff --git a/libcxx/modules/std/algorithm.cppm b/libcxx/modules/std/algorithm.inc rename from libcxx/modules/std/algorithm.cppm rename to libcxx/modules/std/algorithm.inc --- a/libcxx/modules/std/algorithm.cppm +++ b/libcxx/modules/std/algorithm.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:algorithm; export namespace std { namespace ranges { // [algorithms.results], algorithm result types diff --git a/libcxx/modules/std/any.cppm b/libcxx/modules/std/any.inc rename from libcxx/modules/std/any.cppm rename to libcxx/modules/std/any.inc --- a/libcxx/modules/std/any.cppm +++ b/libcxx/modules/std/any.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:any; export namespace std { // [any.bad.any.cast], class bad_any_cast diff --git a/libcxx/modules/std/array.cppm b/libcxx/modules/std/array.inc rename from libcxx/modules/std/array.cppm rename to libcxx/modules/std/array.inc --- a/libcxx/modules/std/array.cppm +++ b/libcxx/modules/std/array.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:array; export namespace std { // [array], class template array diff --git a/libcxx/modules/std/atomic.cppm b/libcxx/modules/std/atomic.inc rename from libcxx/modules/std/atomic.cppm rename to libcxx/modules/std/atomic.inc --- a/libcxx/modules/std/atomic.cppm +++ b/libcxx/modules/std/atomic.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:atomic; export namespace std { // [atomics.order], order and consistency diff --git a/libcxx/modules/std/barrier.cppm b/libcxx/modules/std/barrier.inc rename from libcxx/modules/std/barrier.cppm rename to libcxx/modules/std/barrier.inc --- a/libcxx/modules/std/barrier.cppm +++ b/libcxx/modules/std/barrier.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:barrier; export namespace std { using std::barrier; } // namespace std diff --git a/libcxx/modules/std/bit.cppm b/libcxx/modules/std/bit.inc rename from libcxx/modules/std/bit.cppm rename to libcxx/modules/std/bit.inc --- a/libcxx/modules/std/bit.cppm +++ b/libcxx/modules/std/bit.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:bit; export namespace std { // [bit.cast], bit_cast using std::bit_cast; diff --git a/libcxx/modules/std/bitset.cppm b/libcxx/modules/std/bitset.inc rename from libcxx/modules/std/bitset.cppm rename to libcxx/modules/std/bitset.inc --- a/libcxx/modules/std/bitset.cppm +++ b/libcxx/modules/std/bitset.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:bitset; export namespace std { using std::bitset; diff --git a/libcxx/modules/std/cfloat.cppm b/libcxx/modules/std/cassert.inc rename from libcxx/modules/std/cfloat.cppm rename to libcxx/modules/std/cassert.inc --- a/libcxx/modules/std/cfloat.cppm +++ b/libcxx/modules/std/cassert.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cfloat; export namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/modules/std/cctype.cppm b/libcxx/modules/std/cctype.inc rename from libcxx/modules/std/cctype.cppm rename to libcxx/modules/std/cctype.inc --- a/libcxx/modules/std/cctype.cppm +++ b/libcxx/modules/std/cctype.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cctype; export namespace std { using std::isalnum; using std::isalpha; diff --git a/libcxx/modules/std/cerrno.cppm b/libcxx/modules/std/cerrno.inc rename from libcxx/modules/std/cerrno.cppm rename to libcxx/modules/std/cerrno.inc --- a/libcxx/modules/std/cerrno.cppm +++ b/libcxx/modules/std/cerrno.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cerrno; export namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/modules/std/cfenv.cppm b/libcxx/modules/std/cfenv.inc rename from libcxx/modules/std/cfenv.cppm rename to libcxx/modules/std/cfenv.inc --- a/libcxx/modules/std/cfenv.cppm +++ b/libcxx/modules/std/cfenv.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cfenv; export namespace std { // types using std::fenv_t; diff --git a/libcxx/modules/std/cassert.cppm b/libcxx/modules/std/cfloat.inc rename from libcxx/modules/std/cassert.cppm rename to libcxx/modules/std/cfloat.inc --- a/libcxx/modules/std/cassert.cppm +++ b/libcxx/modules/std/cfloat.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cassert; export namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/modules/std/charconv.cppm b/libcxx/modules/std/charconv.inc rename from libcxx/modules/std/charconv.cppm rename to libcxx/modules/std/charconv.inc --- a/libcxx/modules/std/charconv.cppm +++ b/libcxx/modules/std/charconv.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:charconv; export namespace std { // floating-point format for primitive numerical conversion diff --git a/libcxx/modules/std/chrono.cppm b/libcxx/modules/std/chrono.inc rename from libcxx/modules/std/chrono.cppm rename to libcxx/modules/std/chrono.inc --- a/libcxx/modules/std/chrono.cppm +++ b/libcxx/modules/std/chrono.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:chrono; export namespace std { namespace chrono { diff --git a/libcxx/modules/std/cinttypes.cppm b/libcxx/modules/std/cinttypes.inc rename from libcxx/modules/std/cinttypes.cppm rename to libcxx/modules/std/cinttypes.inc --- a/libcxx/modules/std/cinttypes.cppm +++ b/libcxx/modules/std/cinttypes.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cinttypes; export namespace std { using std::imaxdiv_t; diff --git a/libcxx/modules/std/climits.cppm b/libcxx/modules/std/climits.inc rename from libcxx/modules/std/climits.cppm rename to libcxx/modules/std/climits.inc --- a/libcxx/modules/std/climits.cppm +++ b/libcxx/modules/std/climits.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:climits; export namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/modules/std/clocale.cppm b/libcxx/modules/std/clocale.inc rename from libcxx/modules/std/clocale.cppm rename to libcxx/modules/std/clocale.inc --- a/libcxx/modules/std/clocale.cppm +++ b/libcxx/modules/std/clocale.inc @@ -7,19 +7,11 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:clocale; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::lconv; using std::localeconv; using std::setlocale; - -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/cmath.cppm b/libcxx/modules/std/cmath.inc rename from libcxx/modules/std/cmath.cppm rename to libcxx/modules/std/cmath.inc --- a/libcxx/modules/std/cmath.cppm +++ b/libcxx/modules/std/cmath.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cmath; export namespace std { using std::double_t; diff --git a/libcxx/modules/std/codecvt.cppm b/libcxx/modules/std/codecvt.inc rename from libcxx/modules/std/codecvt.cppm rename to libcxx/modules/std/codecvt.inc --- a/libcxx/modules/std/codecvt.cppm +++ b/libcxx/modules/std/codecvt.inc @@ -7,21 +7,12 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:codecvt; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { - +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::codecvt_mode; using std::codecvt_utf16; using std::codecvt_utf8; using std::codecvt_utf8_utf16; - -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/compare.cppm b/libcxx/modules/std/compare.inc rename from libcxx/modules/std/compare.cppm rename to libcxx/modules/std/compare.inc --- a/libcxx/modules/std/compare.cppm +++ b/libcxx/modules/std/compare.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:compare; export namespace std { // [cmp.categories], comparison category types diff --git a/libcxx/modules/std/complex.cppm b/libcxx/modules/std/complex.inc rename from libcxx/modules/std/complex.cppm rename to libcxx/modules/std/complex.inc --- a/libcxx/modules/std/complex.cppm +++ b/libcxx/modules/std/complex.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:complex; export namespace std { // [complex], class template complex diff --git a/libcxx/modules/std/concepts.cppm b/libcxx/modules/std/concepts.inc rename from libcxx/modules/std/concepts.cppm rename to libcxx/modules/std/concepts.inc --- a/libcxx/modules/std/concepts.cppm +++ b/libcxx/modules/std/concepts.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:concepts; export namespace std { // [concepts.lang], language-related concepts diff --git a/libcxx/modules/std/condition_variable.cppm b/libcxx/modules/std/condition_variable.inc rename from libcxx/modules/std/condition_variable.cppm rename to libcxx/modules/std/condition_variable.inc --- a/libcxx/modules/std/condition_variable.cppm +++ b/libcxx/modules/std/condition_variable.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:condition_variable; export namespace std { // [thread.condition.condvar], class condition_variable diff --git a/libcxx/modules/std/coroutine.cppm b/libcxx/modules/std/coroutine.inc rename from libcxx/modules/std/coroutine.cppm rename to libcxx/modules/std/coroutine.inc --- a/libcxx/modules/std/coroutine.cppm +++ b/libcxx/modules/std/coroutine.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include -#include -export module std:coroutine; export namespace std { // [coroutine.traits], coroutine traits diff --git a/libcxx/modules/std/csetjmp.cppm b/libcxx/modules/std/csetjmp.inc rename from libcxx/modules/std/csetjmp.cppm rename to libcxx/modules/std/csetjmp.inc --- a/libcxx/modules/std/csetjmp.cppm +++ b/libcxx/modules/std/csetjmp.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:csetjmp; export namespace std { using std::jmp_buf; using std::longjmp; diff --git a/libcxx/modules/std/csignal.cppm b/libcxx/modules/std/csignal.inc rename from libcxx/modules/std/csignal.cppm rename to libcxx/modules/std/csignal.inc --- a/libcxx/modules/std/csignal.cppm +++ b/libcxx/modules/std/csignal.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:csignal; export namespace std { using std::sig_atomic_t; diff --git a/libcxx/modules/std/cstdarg.cppm b/libcxx/modules/std/cstdarg.inc rename from libcxx/modules/std/cstdarg.cppm rename to libcxx/modules/std/cstdarg.inc --- a/libcxx/modules/std/cstdarg.cppm +++ b/libcxx/modules/std/cstdarg.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstdarg; export namespace std { using std::va_list; } // namespace std diff --git a/libcxx/modules/std/cstddef.cppm b/libcxx/modules/std/cstddef.inc rename from libcxx/modules/std/cstddef.cppm rename to libcxx/modules/std/cstddef.inc --- a/libcxx/modules/std/cstddef.cppm +++ b/libcxx/modules/std/cstddef.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstddef; export namespace std { using std::max_align_t; using std::nullptr_t; diff --git a/libcxx/modules/std/cstdint.cppm b/libcxx/modules/std/cstdint.inc rename from libcxx/modules/std/cstdint.cppm rename to libcxx/modules/std/cstdint.inc --- a/libcxx/modules/std/cstdint.cppm +++ b/libcxx/modules/std/cstdint.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstdint; export namespace std { // signed using std::int8_t _LIBCPP_USING_IF_EXISTS; diff --git a/libcxx/modules/std/cstdio.cppm b/libcxx/modules/std/cstdio.inc rename from libcxx/modules/std/cstdio.cppm rename to libcxx/modules/std/cstdio.inc --- a/libcxx/modules/std/cstdio.cppm +++ b/libcxx/modules/std/cstdio.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstdio; export namespace std { using std::FILE; using std::fpos_t; diff --git a/libcxx/modules/std/cstdlib.cppm b/libcxx/modules/std/cstdlib.inc rename from libcxx/modules/std/cstdlib.cppm rename to libcxx/modules/std/cstdlib.inc --- a/libcxx/modules/std/cstdlib.cppm +++ b/libcxx/modules/std/cstdlib.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstdlib; export namespace std { using std::div_t; using std::ldiv_t; diff --git a/libcxx/modules/std/cstring.cppm b/libcxx/modules/std/cstring.inc rename from libcxx/modules/std/cstring.cppm rename to libcxx/modules/std/cstring.inc --- a/libcxx/modules/std/cstring.cppm +++ b/libcxx/modules/std/cstring.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cstring; export namespace std { using std::size_t; diff --git a/libcxx/modules/std/ctime.cppm b/libcxx/modules/std/ctime.inc rename from libcxx/modules/std/ctime.cppm rename to libcxx/modules/std/ctime.inc --- a/libcxx/modules/std/ctime.cppm +++ b/libcxx/modules/std/ctime.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:ctime; export namespace std { using std::clock_t; using std::size_t; diff --git a/libcxx/modules/std/cuchar.cppm b/libcxx/modules/std/cuchar.inc rename from libcxx/modules/std/cuchar.cppm rename to libcxx/modules/std/cuchar.inc --- a/libcxx/modules/std/cuchar.cppm +++ b/libcxx/modules/std/cuchar.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cuchar; export namespace std { // Note the Standard does not mark these symbols optional, but libc++'s header // does. So this seems strictly not to be conforming. @@ -21,7 +17,7 @@ // size_t is conditionally here, but always present in cstddef.cppm. To avoid // conflicing declarations omit the using here. -# if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8) +#if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8) using std::mbrtoc8 _LIBCPP_USING_IF_EXISTS; using std::c8rtomb _LIBCPP_USING_IF_EXISTS; #endif diff --git a/libcxx/modules/std/cwchar.cppm b/libcxx/modules/std/cwchar.inc rename from libcxx/modules/std/cwchar.cppm rename to libcxx/modules/std/cwchar.inc --- a/libcxx/modules/std/cwchar.cppm +++ b/libcxx/modules/std/cwchar.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -# include -#endif - -export module std:cwchar; -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS export namespace std { +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::mbstate_t; using std::size_t; using std::wint_t; @@ -83,6 +76,5 @@ using std::mbsrtowcs; using std::wcrtomb; using std::wcsrtombs; - -} // namespace std #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +} // namespace std diff --git a/libcxx/modules/std/cwctype.cppm b/libcxx/modules/std/cwctype.inc rename from libcxx/modules/std/cwctype.cppm rename to libcxx/modules/std/cwctype.inc --- a/libcxx/modules/std/cwctype.cppm +++ b/libcxx/modules/std/cwctype.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -# include -#endif - -export module std:cwctype; -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS export namespace std { +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wctrans_t; using std::wctype_t; using std::wint_t; @@ -38,5 +31,5 @@ using std::towupper; using std::wctrans; using std::wctype; -} // namespace std #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +} // namespace std diff --git a/libcxx/modules/std/deque.cppm b/libcxx/modules/std/deque.inc rename from libcxx/modules/std/deque.cppm rename to libcxx/modules/std/deque.inc --- a/libcxx/modules/std/deque.cppm +++ b/libcxx/modules/std/deque.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:deque; export namespace std { // [deque], class template deque using std::deque; diff --git a/libcxx/modules/std/exception.cppm b/libcxx/modules/std/exception.inc rename from libcxx/modules/std/exception.cppm rename to libcxx/modules/std/exception.inc --- a/libcxx/modules/std/exception.cppm +++ b/libcxx/modules/std/exception.inc @@ -7,9 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include -export module std:exception; export namespace std { using std::bad_exception; using std::current_exception; diff --git a/libcxx/modules/std/execution.cppm b/libcxx/modules/std/execution.inc rename from libcxx/modules/std/execution.cppm rename to libcxx/modules/std/execution.inc --- a/libcxx/modules/std/execution.cppm +++ b/libcxx/modules/std/execution.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:execution; export namespace std { // [execpol.type], execution policy type trait using std::is_execution_policy; diff --git a/libcxx/modules/std/expected.cppm b/libcxx/modules/std/expected.inc rename from libcxx/modules/std/expected.cppm rename to libcxx/modules/std/expected.inc --- a/libcxx/modules/std/expected.cppm +++ b/libcxx/modules/std/expected.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:expected; export namespace std { // [expected.unexpected], class template unexpected using std::unexpected; diff --git a/libcxx/modules/std/filesystem.cppm b/libcxx/modules/std/filesystem.inc rename from libcxx/modules/std/filesystem.cppm rename to libcxx/modules/std/filesystem.inc --- a/libcxx/modules/std/filesystem.cppm +++ b/libcxx/modules/std/filesystem.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:filesystem; export namespace std::filesystem { // [fs.class.path], paths using std::filesystem::path; diff --git a/libcxx/modules/std/flat_map.cppm b/libcxx/modules/std/flat_map.inc rename from libcxx/modules/std/flat_map.cppm rename to libcxx/modules/std/flat_map.inc --- a/libcxx/modules/std/flat_map.cppm +++ b/libcxx/modules/std/flat_map.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:flat_map; export namespace std { #if 0 // [flat.map], class template flat_­map diff --git a/libcxx/modules/std/flat_set.cppm b/libcxx/modules/std/flat_set.inc rename from libcxx/modules/std/flat_set.cppm rename to libcxx/modules/std/flat_set.inc --- a/libcxx/modules/std/flat_set.cppm +++ b/libcxx/modules/std/flat_set.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:flat_set; export namespace std { #if 0 // [flat.set], class template flat_­set diff --git a/libcxx/modules/std/format.cppm b/libcxx/modules/std/format.inc rename from libcxx/modules/std/format.cppm rename to libcxx/modules/std/format.inc --- a/libcxx/modules/std/format.cppm +++ b/libcxx/modules/std/format.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:format; export namespace std { // [format.context], class template basic_format_context using std::basic_format_context; diff --git a/libcxx/modules/std/forward_list.cppm b/libcxx/modules/std/forward_list.inc rename from libcxx/modules/std/forward_list.cppm rename to libcxx/modules/std/forward_list.inc --- a/libcxx/modules/std/forward_list.cppm +++ b/libcxx/modules/std/forward_list.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:forward_list; export namespace std { // [forward.list], class template forward_list using std::forward_list; diff --git a/libcxx/modules/std/fstream.cppm b/libcxx/modules/std/fstream.inc rename from libcxx/modules/std/fstream.cppm rename to libcxx/modules/std/fstream.inc --- a/libcxx/modules/std/fstream.cppm +++ b/libcxx/modules/std/fstream.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:fstream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_filebuf; using std::swap; @@ -45,5 +38,5 @@ # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wfstream; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/functional.cppm b/libcxx/modules/std/functional.inc rename from libcxx/modules/std/functional.cppm rename to libcxx/modules/std/functional.inc --- a/libcxx/modules/std/functional.cppm +++ b/libcxx/modules/std/functional.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:functional; export namespace std { // [func.invoke], invoke using std::invoke; diff --git a/libcxx/modules/std/future.cppm b/libcxx/modules/std/future.inc rename from libcxx/modules/std/future.cppm rename to libcxx/modules/std/future.inc --- a/libcxx/modules/std/future.cppm +++ b/libcxx/modules/std/future.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:future; export namespace std { using std::future_errc; using std::future_status; diff --git a/libcxx/modules/std/generator.cppm b/libcxx/modules/std/generator.cppm deleted file mode 100644 --- a/libcxx/modules/std/generator.cppm +++ /dev/null @@ -1,21 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:generator; -export namespace std { -#if 0 - using std::generator; -#endif -} // namespace std diff --git a/libcxx/modules/std/latch.cppm b/libcxx/modules/std/generator.inc rename from libcxx/modules/std/latch.cppm rename to libcxx/modules/std/generator.inc --- a/libcxx/modules/std/latch.cppm +++ b/libcxx/modules/std/generator.inc @@ -7,10 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:latch; export namespace std { - using std::latch; +#if 0 + using std::generator; +#endif } // namespace std diff --git a/libcxx/modules/std/hazard_pointer.cppm b/libcxx/modules/std/hazard_pointer.inc rename from libcxx/modules/std/hazard_pointer.cppm rename to libcxx/modules/std/hazard_pointer.inc --- a/libcxx/modules/std/hazard_pointer.cppm +++ b/libcxx/modules/std/hazard_pointer.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:hazard_pointer; export namespace std { #if 0 # if _LIBCPP_STD_VER >= 23 diff --git a/libcxx/modules/std/initializer_list.cppm b/libcxx/modules/std/initializer_list.inc rename from libcxx/modules/std/initializer_list.cppm rename to libcxx/modules/std/initializer_list.inc --- a/libcxx/modules/std/initializer_list.cppm +++ b/libcxx/modules/std/initializer_list.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:initializer_list; export namespace std { using std::initializer_list; diff --git a/libcxx/modules/std/iomanip.cppm b/libcxx/modules/std/iomanip.inc rename from libcxx/modules/std/iomanip.cppm rename to libcxx/modules/std/iomanip.inc --- a/libcxx/modules/std/iomanip.cppm +++ b/libcxx/modules/std/iomanip.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:iomanip; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::get_money; using std::get_time; using std::put_money; @@ -28,5 +21,5 @@ using std::setw; using std::quoted; -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/ios.cppm b/libcxx/modules/std/ios.inc rename from libcxx/modules/std/ios.cppm rename to libcxx/modules/std/ios.inc --- a/libcxx/modules/std/ios.cppm +++ b/libcxx/modules/std/ios.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:ios; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::fpos; // based on [tab:fpos.operations] using std::operator!=; // Note not affected by P1614, seems like a bug. @@ -79,5 +72,5 @@ # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wios; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/iosfwd.cppm b/libcxx/modules/std/iosfwd.inc rename from libcxx/modules/std/iosfwd.cppm rename to libcxx/modules/std/iosfwd.inc --- a/libcxx/modules/std/iosfwd.cppm +++ b/libcxx/modules/std/iosfwd.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:iosfwd; export namespace std { using std::streampos; #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS diff --git a/libcxx/modules/std/iostream.cppm b/libcxx/modules/std/iostream.inc rename from libcxx/modules/std/iostream.cppm rename to libcxx/modules/std/iostream.inc --- a/libcxx/modules/std/iostream.cppm +++ b/libcxx/modules/std/iostream.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:iostream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::cerr; using std::cin; using std::clog; @@ -27,5 +20,5 @@ using std::wclog; using std::wcout; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/istream.cppm b/libcxx/modules/std/istream.inc rename from libcxx/modules/std/istream.cppm rename to libcxx/modules/std/istream.inc --- a/libcxx/modules/std/istream.cppm +++ b/libcxx/modules/std/istream.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:istream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_istream; using std::istream; @@ -33,5 +26,5 @@ using std::ws; using std::operator>>; -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/iterator.cppm b/libcxx/modules/std/iterator.inc rename from libcxx/modules/std/iterator.cppm rename to libcxx/modules/std/iterator.inc --- a/libcxx/modules/std/iterator.cppm +++ b/libcxx/modules/std/iterator.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:iterator; export namespace std { // [iterator.assoc.types], associated types // [incrementable.traits], incrementable traits diff --git a/libcxx/modules/std/latch.cppm b/libcxx/modules/std/latch.inc rename from libcxx/modules/std/latch.cppm rename to libcxx/modules/std/latch.inc --- a/libcxx/modules/std/latch.cppm +++ b/libcxx/modules/std/latch.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:latch; export namespace std { using std::latch; } // namespace std diff --git a/libcxx/modules/std/limits.cppm b/libcxx/modules/std/limits.inc rename from libcxx/modules/std/limits.cppm rename to libcxx/modules/std/limits.inc --- a/libcxx/modules/std/limits.cppm +++ b/libcxx/modules/std/limits.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:limits; export namespace std { // [fp.style], floating-point type properties using std::float_denorm_style; diff --git a/libcxx/modules/std/list.cppm b/libcxx/modules/std/list.inc rename from libcxx/modules/std/list.cppm rename to libcxx/modules/std/list.inc --- a/libcxx/modules/std/list.cppm +++ b/libcxx/modules/std/list.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:list; export namespace std { // [list], class template list using std::list; diff --git a/libcxx/modules/std/locale.cppm b/libcxx/modules/std/locale.inc rename from libcxx/modules/std/locale.cppm rename to libcxx/modules/std/locale.inc --- a/libcxx/modules/std/locale.cppm +++ b/libcxx/modules/std/locale.inc @@ -7,14 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:locale; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { // [locale], locale using std::has_facet; @@ -80,4 +72,3 @@ // [depr.conversions.string] using std::wstring_convert; } // namespace std -#endif // _LIBCPP_HAS_NO_LOCALIZATION diff --git a/libcxx/modules/std/map.cppm b/libcxx/modules/std/map.inc rename from libcxx/modules/std/map.cppm rename to libcxx/modules/std/map.inc --- a/libcxx/modules/std/map.cppm +++ b/libcxx/modules/std/map.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:map; export namespace std { // [map], class template map using std::map; diff --git a/libcxx/modules/std/mdspan.cppm b/libcxx/modules/std/mdspan.inc rename from libcxx/modules/std/mdspan.cppm rename to libcxx/modules/std/mdspan.inc --- a/libcxx/modules/std/mdspan.cppm +++ b/libcxx/modules/std/mdspan.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:mdspan; export namespace std { // [mdspan.extents], class template extents using std::extents; diff --git a/libcxx/modules/std/memory.cppm b/libcxx/modules/std/memory.inc rename from libcxx/modules/std/memory.cppm rename to libcxx/modules/std/memory.inc --- a/libcxx/modules/std/memory.cppm +++ b/libcxx/modules/std/memory.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:memory; export namespace std { // [pointer.traits], pointer traits using std::pointer_traits; diff --git a/libcxx/modules/std/memory_resource.cppm b/libcxx/modules/std/memory_resource.inc rename from libcxx/modules/std/memory_resource.cppm rename to libcxx/modules/std/memory_resource.inc --- a/libcxx/modules/std/memory_resource.cppm +++ b/libcxx/modules/std/memory_resource.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:memory_resource; export namespace std::pmr { // [mem.res.class], class memory_resource using std::pmr::memory_resource; diff --git a/libcxx/modules/std/mutex.cppm b/libcxx/modules/std/mutex.inc rename from libcxx/modules/std/mutex.cppm rename to libcxx/modules/std/mutex.inc --- a/libcxx/modules/std/mutex.cppm +++ b/libcxx/modules/std/mutex.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:mutex; export namespace std { // [thread.mutex.class], class mutex using std::mutex; diff --git a/libcxx/modules/std/new.cppm b/libcxx/modules/std/new.inc rename from libcxx/modules/std/new.cppm rename to libcxx/modules/std/new.inc --- a/libcxx/modules/std/new.cppm +++ b/libcxx/modules/std/new.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:__new; // Note new is a keyword and not a valid identifier export namespace std { // [alloc.errors], storage allocation errors using std::bad_alloc; diff --git a/libcxx/modules/std/numbers.cppm b/libcxx/modules/std/numbers.inc rename from libcxx/modules/std/numbers.cppm rename to libcxx/modules/std/numbers.inc --- a/libcxx/modules/std/numbers.cppm +++ b/libcxx/modules/std/numbers.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:numbers; export namespace std::numbers { using std::numbers::e_v; using std::numbers::egamma_v; diff --git a/libcxx/modules/std/numeric.cppm b/libcxx/modules/std/numeric.inc rename from libcxx/modules/std/numeric.cppm rename to libcxx/modules/std/numeric.inc --- a/libcxx/modules/std/numeric.cppm +++ b/libcxx/modules/std/numeric.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:numeric; export namespace std { // [accumulate], accumulate using std::accumulate; diff --git a/libcxx/modules/std/optional.cppm b/libcxx/modules/std/optional.inc rename from libcxx/modules/std/optional.cppm rename to libcxx/modules/std/optional.inc --- a/libcxx/modules/std/optional.cppm +++ b/libcxx/modules/std/optional.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:optional; export namespace std { // [optional.optional], class template optional using std::optional; diff --git a/libcxx/modules/std/ostream.cppm b/libcxx/modules/std/ostream.inc rename from libcxx/modules/std/ostream.cppm rename to libcxx/modules/std/ostream.inc --- a/libcxx/modules/std/ostream.cppm +++ b/libcxx/modules/std/ostream.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:ostream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_ostream; using std::ostream; @@ -42,5 +35,5 @@ using std::vprint_nonunicode; using std::vprint_unicode; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/print.cppm b/libcxx/modules/std/print.inc rename from libcxx/modules/std/print.cppm rename to libcxx/modules/std/print.inc --- a/libcxx/modules/std/print.cppm +++ b/libcxx/modules/std/print.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:print; export namespace std { // [print.fun], print functions using std::print; diff --git a/libcxx/modules/std/queue.cppm b/libcxx/modules/std/queue.inc rename from libcxx/modules/std/queue.cppm rename to libcxx/modules/std/queue.inc --- a/libcxx/modules/std/queue.cppm +++ b/libcxx/modules/std/queue.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:queue; export namespace std { // [queue], class template queue using std::queue; diff --git a/libcxx/modules/std/random.cppm b/libcxx/modules/std/random.inc rename from libcxx/modules/std/random.cppm rename to libcxx/modules/std/random.inc --- a/libcxx/modules/std/random.cppm +++ b/libcxx/modules/std/random.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:random; export namespace std { // [rand.req.urng], uniform random bit generator requirements using std::uniform_random_bit_generator; diff --git a/libcxx/modules/std/ranges.cppm b/libcxx/modules/std/ranges.inc rename from libcxx/modules/std/ranges.cppm rename to libcxx/modules/std/ranges.inc --- a/libcxx/modules/std/ranges.cppm +++ b/libcxx/modules/std/ranges.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:ranges; export namespace std { namespace ranges { inline namespace __cpo { diff --git a/libcxx/modules/std/ratio.cppm b/libcxx/modules/std/ratio.inc rename from libcxx/modules/std/ratio.cppm rename to libcxx/modules/std/ratio.inc --- a/libcxx/modules/std/ratio.cppm +++ b/libcxx/modules/std/ratio.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:ratio; export namespace std { // [ratio.ratio], class template ratio using std::ratio; diff --git a/libcxx/modules/std/rcu.cppm b/libcxx/modules/std/rcu.inc rename from libcxx/modules/std/rcu.cppm rename to libcxx/modules/std/rcu.inc --- a/libcxx/modules/std/rcu.cppm +++ b/libcxx/modules/std/rcu.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:rcu; export namespace std { #if 0 # if _LIBCPP_STD_VER >= 23 diff --git a/libcxx/modules/std/regex.cppm b/libcxx/modules/std/regex.inc rename from libcxx/modules/std/regex.cppm rename to libcxx/modules/std/regex.inc --- a/libcxx/modules/std/regex.cppm +++ b/libcxx/modules/std/regex.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:regex; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION // [re.const], regex constants namespace regex_constants { using std::regex_constants::error_type; @@ -119,6 +112,6 @@ using std::pmr::wcmatch; using std::pmr::wsmatch; # endif - } // namespace pmr -} // namespace std + } // namespace pmr #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/scoped_allocator.cppm b/libcxx/modules/std/scoped_allocator.inc rename from libcxx/modules/std/scoped_allocator.cppm rename to libcxx/modules/std/scoped_allocator.inc --- a/libcxx/modules/std/scoped_allocator.cppm +++ b/libcxx/modules/std/scoped_allocator.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:scoped_allocator; export namespace std { // class template scoped_allocator_adaptor using std::scoped_allocator_adaptor; diff --git a/libcxx/modules/std/semaphore.cppm b/libcxx/modules/std/semaphore.inc rename from libcxx/modules/std/semaphore.cppm rename to libcxx/modules/std/semaphore.inc --- a/libcxx/modules/std/semaphore.cppm +++ b/libcxx/modules/std/semaphore.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:semaphore; export namespace std { // [thread.sema.cnt], class template counting_semaphore using std::counting_semaphore; diff --git a/libcxx/modules/std/set.cppm b/libcxx/modules/std/set.inc rename from libcxx/modules/std/set.cppm rename to libcxx/modules/std/set.inc --- a/libcxx/modules/std/set.cppm +++ b/libcxx/modules/std/set.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:set; export namespace std { // [set], class template set using std::set; diff --git a/libcxx/modules/std/shared_mutex.cppm b/libcxx/modules/std/shared_mutex.inc rename from libcxx/modules/std/shared_mutex.cppm rename to libcxx/modules/std/shared_mutex.inc --- a/libcxx/modules/std/shared_mutex.cppm +++ b/libcxx/modules/std/shared_mutex.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:shared_mutex; export namespace std { // [thread.sharedmutex.class], class shared_­mutex using std::shared_mutex; diff --git a/libcxx/modules/std/source_location.cppm b/libcxx/modules/std/source_location.inc rename from libcxx/modules/std/source_location.cppm rename to libcxx/modules/std/source_location.inc --- a/libcxx/modules/std/source_location.cppm +++ b/libcxx/modules/std/source_location.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:source_location; export namespace std { using std::source_location; } // namespace std diff --git a/libcxx/modules/std/span.cppm b/libcxx/modules/std/span.inc rename from libcxx/modules/std/span.cppm rename to libcxx/modules/std/span.inc --- a/libcxx/modules/std/span.cppm +++ b/libcxx/modules/std/span.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:span; export namespace std { // constants using std::dynamic_extent; diff --git a/libcxx/modules/std/spanstream.cppm b/libcxx/modules/std/spanstream.inc rename from libcxx/modules/std/spanstream.cppm rename to libcxx/modules/std/spanstream.inc --- a/libcxx/modules/std/spanstream.cppm +++ b/libcxx/modules/std/spanstream.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:spanstream; export namespace std { #if 0 using std::basic_spanbuf; diff --git a/libcxx/modules/std/sstream.cppm b/libcxx/modules/std/sstream.inc rename from libcxx/modules/std/sstream.cppm rename to libcxx/modules/std/sstream.inc --- a/libcxx/modules/std/sstream.cppm +++ b/libcxx/modules/std/sstream.inc @@ -7,15 +7,8 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:sstream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_stringbuf; using std::swap; @@ -45,5 +38,5 @@ # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wstringstream; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/stack.cppm b/libcxx/modules/std/stack.inc rename from libcxx/modules/std/stack.cppm rename to libcxx/modules/std/stack.inc --- a/libcxx/modules/std/stack.cppm +++ b/libcxx/modules/std/stack.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:stack; export namespace std { // [stack], class template stack using std::stack; diff --git a/libcxx/modules/std/stacktrace.cppm b/libcxx/modules/std/stacktrace.inc rename from libcxx/modules/std/stacktrace.cppm rename to libcxx/modules/std/stacktrace.inc --- a/libcxx/modules/std/stacktrace.cppm +++ b/libcxx/modules/std/stacktrace.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:stacktrace; export namespace std { #if 0 // [stacktrace.entry], class stacktrace_­entry diff --git a/libcxx/modules/std/stdexcept.cppm b/libcxx/modules/std/stdexcept.inc rename from libcxx/modules/std/stdexcept.cppm rename to libcxx/modules/std/stdexcept.inc --- a/libcxx/modules/std/stdexcept.cppm +++ b/libcxx/modules/std/stdexcept.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:stdexcept; export namespace std { using std::domain_error; using std::invalid_argument; diff --git a/libcxx/modules/std/stdfloat.cppm b/libcxx/modules/std/stdfloat.inc rename from libcxx/modules/std/stdfloat.cppm rename to libcxx/modules/std/stdfloat.inc --- a/libcxx/modules/std/stdfloat.cppm +++ b/libcxx/modules/std/stdfloat.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally" -# include -#endif - -export module std:stdfloat; export namespace std { #if defined(__STDCPP_FLOAT16_T__) using std::float16_t; diff --git a/libcxx/modules/std/stop_token.cppm b/libcxx/modules/std/stop_token.inc rename from libcxx/modules/std/stop_token.cppm rename to libcxx/modules/std/stop_token.inc --- a/libcxx/modules/std/stop_token.cppm +++ b/libcxx/modules/std/stop_token.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:stop_token; export namespace std { // [stoptoken], class stop_­token using std::stop_token; diff --git a/libcxx/modules/std/streambuf.cppm b/libcxx/modules/std/streambuf.inc rename from libcxx/modules/std/streambuf.cppm rename to libcxx/modules/std/streambuf.inc --- a/libcxx/modules/std/streambuf.cppm +++ b/libcxx/modules/std/streambuf.inc @@ -7,19 +7,12 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:streambuf; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_streambuf; using std::streambuf; # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS using std::wstreambuf; # endif -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/string.cppm b/libcxx/modules/std/string.inc rename from libcxx/modules/std/string.cppm rename to libcxx/modules/std/string.inc --- a/libcxx/modules/std/string.cppm +++ b/libcxx/modules/std/string.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:string; export namespace std { // [char.traits], character traits using std::char_traits; diff --git a/libcxx/modules/std/string_view.cppm b/libcxx/modules/std/string_view.inc rename from libcxx/modules/std/string_view.cppm rename to libcxx/modules/std/string_view.inc --- a/libcxx/modules/std/string_view.cppm +++ b/libcxx/modules/std/string_view.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:string_view; export namespace std { // [string.view.template], class template basic_string_view using std::basic_string_view; diff --git a/libcxx/modules/std/strstream.cppm b/libcxx/modules/std/strstream.inc rename from libcxx/modules/std/strstream.cppm rename to libcxx/modules/std/strstream.inc --- a/libcxx/modules/std/strstream.cppm +++ b/libcxx/modules/std/strstream.inc @@ -7,18 +7,11 @@ // //===----------------------------------------------------------------------===// -module; -#include <__config> -#ifndef _LIBCPP_HAS_NO_LOCALIZATION -# include -#endif - -export module std:strstream; -#ifndef _LIBCPP_HAS_NO_LOCALIZATION export namespace std { +#ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::istrstream; using std::ostrstream; using std::strstream; using std::strstreambuf; -} // namespace std #endif // _LIBCPP_HAS_NO_LOCALIZATION +} // namespace std diff --git a/libcxx/modules/std/syncstream.cppm b/libcxx/modules/std/syncstream.inc rename from libcxx/modules/std/syncstream.cppm rename to libcxx/modules/std/syncstream.inc --- a/libcxx/modules/std/syncstream.cppm +++ b/libcxx/modules/std/syncstream.inc @@ -7,13 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:syncstream; export namespace std { #if 0 using std::basic_syncbuf; diff --git a/libcxx/modules/std/system_error.cppm b/libcxx/modules/std/system_error.inc rename from libcxx/modules/std/system_error.cppm rename to libcxx/modules/std/system_error.inc --- a/libcxx/modules/std/system_error.cppm +++ b/libcxx/modules/std/system_error.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:system_error; export namespace std { using std::error_category; using std::generic_category; diff --git a/libcxx/modules/std/text_encoding.cppm b/libcxx/modules/std/text_encoding.cppm deleted file mode 100644 --- a/libcxx/modules/std/text_encoding.cppm +++ /dev/null @@ -1,26 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -module; -#if __has_include() -# error "include this header unconditionally and uncomment the exported symbols" -# include -#endif - -export module std:text_encoding; -export namespace std { -#if 0 -# if _LIBCPP_STD_VER >= 23 - using std::text_encoding; - - // hash support - using std::hash; -# endif // _LIBCPP_STD_VER >= 23 -#endif -} // namespace std diff --git a/libcxx/modules/std/typeindex.cppm b/libcxx/modules/std/text_encoding.inc rename from libcxx/modules/std/typeindex.cppm rename to libcxx/modules/std/text_encoding.inc --- a/libcxx/modules/std/typeindex.cppm +++ b/libcxx/modules/std/text_encoding.inc @@ -7,11 +7,13 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:typeindex; export namespace std { +#if 0 +# if _LIBCPP_STD_VER >= 23 + using std::text_encoding; + + // hash support using std::hash; - using std::type_index; +# endif // _LIBCPP_STD_VER >= 23 +#endif } // namespace std diff --git a/libcxx/modules/std/thread.cppm b/libcxx/modules/std/thread.inc rename from libcxx/modules/std/thread.cppm rename to libcxx/modules/std/thread.inc --- a/libcxx/modules/std/thread.cppm +++ b/libcxx/modules/std/thread.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:thread; export namespace std { // [thread.thread.class], class thread using std::thread; diff --git a/libcxx/modules/std/tuple.cppm b/libcxx/modules/std/tuple.inc rename from libcxx/modules/std/tuple.cppm rename to libcxx/modules/std/tuple.inc --- a/libcxx/modules/std/tuple.cppm +++ b/libcxx/modules/std/tuple.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:tuple; export namespace std { // [tuple.tuple], class template tuple using std::tuple; diff --git a/libcxx/modules/std/type_traits.cppm b/libcxx/modules/std/type_traits.inc rename from libcxx/modules/std/type_traits.cppm rename to libcxx/modules/std/type_traits.inc --- a/libcxx/modules/std/type_traits.cppm +++ b/libcxx/modules/std/type_traits.inc @@ -7,9 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include -export module std:type_traits; export namespace std { // [meta.help], helper class using std::integral_constant; diff --git a/libcxx/modules/std/typeindex.cppm b/libcxx/modules/std/typeindex.inc rename from libcxx/modules/std/typeindex.cppm rename to libcxx/modules/std/typeindex.inc --- a/libcxx/modules/std/typeindex.cppm +++ b/libcxx/modules/std/typeindex.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:typeindex; export namespace std { using std::hash; using std::type_index; diff --git a/libcxx/modules/std/typeinfo.cppm b/libcxx/modules/std/typeinfo.inc rename from libcxx/modules/std/typeinfo.cppm rename to libcxx/modules/std/typeinfo.inc --- a/libcxx/modules/std/typeinfo.cppm +++ b/libcxx/modules/std/typeinfo.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:typeinfo; export namespace std { using std::bad_cast; using std::bad_typeid; diff --git a/libcxx/modules/std/unordered_map.cppm b/libcxx/modules/std/unordered_map.inc rename from libcxx/modules/std/unordered_map.cppm rename to libcxx/modules/std/unordered_map.inc --- a/libcxx/modules/std/unordered_map.cppm +++ b/libcxx/modules/std/unordered_map.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:unordered_map; export namespace std { // [unord.map], class template unordered_­map using std::unordered_map; diff --git a/libcxx/modules/std/unordered_set.cppm b/libcxx/modules/std/unordered_set.inc rename from libcxx/modules/std/unordered_set.cppm rename to libcxx/modules/std/unordered_set.inc --- a/libcxx/modules/std/unordered_set.cppm +++ b/libcxx/modules/std/unordered_set.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:unordered_set; export namespace std { // [unord.set], class template unordered_­set using std::unordered_set; diff --git a/libcxx/modules/std/utility.cppm b/libcxx/modules/std/utility.inc rename from libcxx/modules/std/utility.cppm rename to libcxx/modules/std/utility.inc --- a/libcxx/modules/std/utility.cppm +++ b/libcxx/modules/std/utility.inc @@ -7,9 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include -export module std:utility; export namespace std { // [utility.swap], swap using std::swap; diff --git a/libcxx/modules/std/valarray.cppm b/libcxx/modules/std/valarray.inc rename from libcxx/modules/std/valarray.cppm rename to libcxx/modules/std/valarray.inc --- a/libcxx/modules/std/valarray.cppm +++ b/libcxx/modules/std/valarray.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:valarray; export namespace std { using std::gslice; using std::gslice_array; diff --git a/libcxx/modules/std/variant.cppm b/libcxx/modules/std/variant.inc rename from libcxx/modules/std/variant.cppm rename to libcxx/modules/std/variant.inc --- a/libcxx/modules/std/variant.cppm +++ b/libcxx/modules/std/variant.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:variant; export namespace std { // [variant.variant], class template variant using std::variant; diff --git a/libcxx/modules/std/vector.cppm b/libcxx/modules/std/vector.inc rename from libcxx/modules/std/vector.cppm rename to libcxx/modules/std/vector.inc --- a/libcxx/modules/std/vector.cppm +++ b/libcxx/modules/std/vector.inc @@ -7,11 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include -#include - -export module std:vector; export namespace std { // [vector], class template vector using std::vector; diff --git a/libcxx/modules/std/version.cppm b/libcxx/modules/std/version.cppm deleted file mode 100644 --- a/libcxx/modules/std/version.cppm +++ /dev/null @@ -1,16 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -module; -#include - -export module std:version; -export namespace std { - // This module exports nothing. -} // namespace std diff --git a/libcxx/modules/std/cfloat.cppm b/libcxx/modules/std/version.inc rename from libcxx/modules/std/cfloat.cppm rename to libcxx/modules/std/version.inc --- a/libcxx/modules/std/cfloat.cppm +++ b/libcxx/modules/std/version.inc @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -module; -#include - -export module std:cfloat; export namespace std { // This module exports nothing. } // namespace std diff --git a/libcxx/test/libcxx/module_std.gen.py b/libcxx/test/libcxx/module_std.gen.py --- a/libcxx/test/libcxx/module_std.gen.py +++ b/libcxx/test/libcxx/module_std.gen.py @@ -119,6 +119,9 @@ # same definition. ExtraHeader["functional"] = "v1/__compare/compare_three_way.h$" +# newline needs to be escaped for the module partition output. +nl = '\\\\n' + # Create empty file with all parts. print( f"""\ @@ -140,14 +143,30 @@ if header.endswith(".h"): # Skip C compatibility headers continue + # Generate a module partition for the header module includes. This + # makes it possible to verify that all headers export all their + # named declarations. + # + # TODO MODULES This needs to take the header restrictions into account. + print( + f"// RUN{BLOCKLIT}: echo -e \"" + f"module;{nl}" + f"#include <{header}>{nl}" + f"{nl}" + f"// Use __libcpp_module_
to ensure that modules {nl}" + f"// are not named as keywords or reserved names.{nl}" + f"export module std:__libcpp_module_{header};{nl}" + f'#include \\"%{{module}}/std/{header}.inc\\"{nl}' + f"\" > %t.{header}.cppm") + # Dump the information as found in the module's cppm file. print( - f"// RUN{BLOCKLIT}: %{{clang-tidy}} %{{module}}/std/{header}.cppm " + f"// RUN{BLOCKLIT}: %{{clang-tidy}} %t.{header}.cppm " " --checks='-*,libcpp-header-exportable-declarations' " " -config='{CheckOptions: [ " " {" " key: libcpp-header-exportable-declarations.Filename, " - f" value: {header}.cppm" + f" value: {header}.inc" " }, {" " key: libcpp-header-exportable-declarations.FileType, " " value: ModulePartition" diff --git a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp --- a/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp +++ b/libcxx/test/tools/clang_tidy_checks/header_exportable_declarations.cpp @@ -222,14 +222,8 @@ if (is_reserved_name(name)) return; - // For modules (std, std.compat) only take the declarations exported from the partitions. - // Making sure no declatations of headers are compared. - if (file_type_ == FileType::Module) - if (clang::Module* M = decl->getOwningModule(); M && M->Kind != clang::Module::ModulePartitionInterface) - return; - - // For module partitions only take exported declarations. - if (file_type_ == FileType::ModulePartition) + // For modules only take the declarations exported. + if (file_type_ == FileType::ModulePartition || file_type_ == FileType::Module) if (decl->getModuleOwnershipKind() != clang::Decl::ModuleOwnershipKind::VisibleWhenImported) return;