[libc++][modules] Removes the module partitions.

This patch is based on the suggestion by @ChuanqiXu on discourse
(https://discourse.llvm.org/t/alternatives-to-the-implementation-of-std-modules/71958)

Instead of making a module partition per header every header gets an inc
file which contains the exports per header. The std module then includes
all public headers and these inc files. The one file per header is
useful for testing purposes. The CI tests whether the exports of a
header's module partition matches the "public" named declarations in the
header. With one file per header this can still be done.

The patch improves compilation time of files using "import std;" and the
size of the std module.

A comparision of the compilation speed using a libc++ test
  build/bin/llvm-lit -a -Dstd=c++23 -Denable_modules=std libcxx/test/std/modules/std.pass.cpp

Which boils down to
  import std;

  int main(int, char**) {
    std::println("Hello modular world");
    return 0;
  }
and has -ftime-report enabled

Before
===-------------------------------------------------------------------------===
                          Clang front-end time report
===-------------------------------------------------------------------------===
  Total Execution Time: 8.6585 seconds (8.6619 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   4.5041 ( 57.2%)   0.4264 ( 54.4%)   4.9305 ( 56.9%)   4.9331 ( 57.0%)  Clang front-end timer
   3.2037 ( 40.7%)   0.2408 ( 30.7%)   3.4445 ( 39.8%)   3.4452 ( 39.8%)  Reading modules
   0.1665 (  2.1%)   0.1170 ( 14.9%)   0.2835 (  3.3%)   0.2837 (  3.3%)  Loading .../build/test/__config_module__/CMakeFiles/std.dir/std.pcm
   7.8744 (100.0%)   0.7842 (100.0%)   8.6585 (100.0%)   8.6619 (100.0%)  Total

After
===-------------------------------------------------------------------------===
                          Clang front-end time report
===-------------------------------------------------------------------------===
  Total Execution Time: 1.2420 seconds (1.2423 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   0.8892 ( 84.6%)   0.1698 ( 88.8%)   1.0590 ( 85.3%)   1.0590 ( 85.2%)  Clang front-end timer
   0.1533 ( 14.6%)   0.0168 (  8.8%)   0.1701 ( 13.7%)   0.1704 ( 13.7%)  Reading modules
   0.0082 (  0.8%)   0.0047 (  2.5%)   0.0129 (  1.0%)   0.0129 (  1.0%)  Loading .../build/test/__config_module__/CMakeFiles/std.dir/std.pcm
   1.0507 (100.0%)   0.1913 (100.0%)   1.2420 (100.0%)   1.2423 (100.0%)  Total

Using "include <print>" instead of "import module;"
===-------------------------------------------------------------------------===
                          Clang front-end time report
===-------------------------------------------------------------------------===
  Total Execution Time: 2.1507 seconds (2.1517 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   1.9714 (100.0%)   0.1793 (100.0%)   2.1507 (100.0%)   2.1517 (100.0%)  Clang front-end timer
   1.9714 (100.0%)   0.1793 (100.0%)   2.1507 (100.0%)   2.1517 (100.0%)  Total

It's possible to use the std module in external projects
(https://libcxx.llvm.org/Modules.html#using-in-external-projects)

Tested this with a private project to validate the size of the generated files:

Before
$ du -sch std-*
448M	std-build
508K	std-src
120K	std-subbuild
449M	total

After
$ du -sch std-*
29M	std-build
1004K	std-src
132K	std-subbuild
30M	total

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D156907
This commit is contained in:
Mark de Wever 2023-08-02 08:16:09 +02:00
parent 606bb8080e
commit 4d4c70c91c
120 changed files with 419 additions and 844 deletions

View File

@ -5,120 +5,117 @@ endif()
# 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 @@ configure_file(
@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}

View File

@ -48,7 +48,7 @@ endif()
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)

21
libcxx/modules/README.md Normal file
View File

@ -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 <locale>"
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.

View File

@ -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;

170
libcxx/modules/std.cppm.in Normal file
View File

@ -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 <algorithm>
#include <any>
#include <array>
#include <atomic>
#include <barrier>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <charconv>
#include <chrono>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <compare>
#include <complex>
#include <concepts>
#include <condition_variable>
#include <coroutine>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cuchar>
#include <deque>
#include <exception>
#include <execution>
#include <expected>
#include <filesystem>
#include <format>
#include <forward_list>
#include <functional>
#include <future>
#include <initializer_list>
#include <iosfwd>
#include <iterator>
#include <latch>
#include <limits>
#include <list>
#include <map>
#include <mdspan>
#include <memory>
#include <memory_resource>
#include <mutex>
#include <new>
#include <numbers>
#include <numeric>
#include <optional>
#include <print>
#include <queue>
#include <random>
#include <ranges>
#include <ratio>
#include <scoped_allocator>
#include <semaphore>
#include <set>
#include <shared_mutex>
#include <source_location>
#include <span>
#include <stack>
#include <stdexcept>
#include <stop_token>
#include <string>
#include <string_view>
#include <system_error>
#include <thread>
#include <tuple>
#include <type_traits>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <variant>
#include <vector>
#include <version>
// *** Headers disabled by a feature ***
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <clocale>
# include <codecvt>
# include <fstream>
# include <iomanip>
# include <ios>
# include <iostream>
# include <istream>
# include <locale>
# include <ostream>
# include <regex>
# include <sstream>
# include <streambuf>
# include <strstream>
#endif // _LIBCPP_HAS_NO_LOCALIZATION
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwchar>
# include <cwctype>
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
// *** Headers not yet available ***
#if __has_include(<generator>)
# error "include <generator> unconditionally"
# include <generator>
#endif // __has_include(<generator>)
#if __has_include(<hazard_pointer>)
# error "include <hazard_pointer> unconditionally"
# include <hazard_pointer>
#endif // __has_include(<hazard_pointer>)
#if __has_include(<flat_map>)
# error "include <flat_map> unconditionally"
# include <flat_map>
#endif // __has_include(<flat_map>)
#if __has_include(<flat_set>)
# error "include <flat_set> unconditionally"
# include <flat_set>
#endif // __has_include(<flat_set>)
#if __has_include(<rcu>)
# error "include <rcu> unconditionally"
# include <rcu>
#endif // __has_include(<rcu>)
#if __has_include(<spanstream>)
# error "include <spanstream> unconditionally"
# include <spanstream>
#endif // __has_include(<spanstream>)
#if __has_include(<stacktrace>)
# error "include <stacktrace> unconditionally"
# include <stacktrace>
#endif // __has_include(<stacktrace>)
#if __has_include(<stdfloat>)
# error "include <stdfloat> unconditionally"
# include <stdfloat>
#endif // __has_include(<stdfloat>)
#if __has_include(<syncstream>)
# error "include <syncstream> unconditionally"
# include <syncstream>
#endif // __has_include(<syncstream>)
#if __has_include(<text_encoding>)
# error "include <text_encoding> unconditionally"
# include <text_encoding>
#endif // __has_include(<text_encoding>)
export module std;
@LIBCXX_MODULE_STD_INCLUDE_SOURCES@

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <algorithm>
export module std:algorithm;
export namespace std {
namespace ranges {
// [algorithms.results], algorithm result types

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <any>
export module std:any;
export namespace std {
// [any.bad.any.cast], class bad_any_cast

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <array>
export module std:array;
export namespace std {
// [array], class template array

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <atomic>
export module std:atomic;
export namespace std {
// [atomics.order], order and consistency

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <barrier>
export module std:barrier;
export namespace std {
using std::barrier;
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <bit>
export module std:bit;
export namespace std {
// [bit.cast], bit_cast
using std::bit_cast;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <bitset>
export module std:bitset;
export namespace std {
using std::bitset;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cerrno>
export module std:cerrno;
export namespace std {
// This module exports nothing.
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cctype>
export module std:cctype;
export namespace std {
using std::isalnum;
using std::isalpha;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cfloat>
export module std:cfloat;
export namespace std {
// This module exports nothing.
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cfenv>
export module std:cfenv;
export namespace std {
// types
using std::fenv_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <climits>
export module std:climits;
export namespace std {
// This module exports nothing.
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <charconv>
export module std:charconv;
export namespace std {
// floating-point format for primitive numerical conversion

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <chrono>
export module std:chrono;
export namespace std {
namespace chrono {

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cinttypes>
export module std:cinttypes;
export namespace std {
using std::imaxdiv_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cassert>
export module std:cassert;
export namespace std {
// This module exports nothing.
} // namespace std

View File

@ -7,19 +7,11 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <clocale>
#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

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cmath>
export module std:cmath;
export namespace std {
using std::double_t;

View File

@ -7,21 +7,12 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <codecvt>
#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

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <compare>
export module std:compare;
export namespace std {
// [cmp.categories], comparison category types

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <complex>
export module std:complex;
export namespace std {
// [complex], class template complex

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <concepts>
export module std:concepts;
export namespace std {
// [concepts.lang], language-related concepts

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <condition_variable>
export module std:condition_variable;
export namespace std {
// [thread.condition.condvar], class condition_variable

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <coroutine>
#include <functional>
export module std:coroutine;
export namespace std {
// [coroutine.traits], coroutine traits

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <csetjmp>
export module std:csetjmp;
export namespace std {
using std::jmp_buf;
using std::longjmp;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <csignal>
export module std:csignal;
export namespace std {
using std::sig_atomic_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstdarg>
export module std:cstdarg;
export namespace std {
using std::va_list;
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstddef>
export module std:cstddef;
export namespace std {
using std::max_align_t;
using std::nullptr_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstdint>
export module std:cstdint;
export namespace std {
// signed
using std::int8_t _LIBCPP_USING_IF_EXISTS;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstdio>
export module std:cstdio;
export namespace std {
using std::FILE;
using std::fpos_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstdlib>
export module std:cstdlib;
export namespace std {
using std::div_t;
using std::ldiv_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cstring>
export module std:cstring;
export namespace std {
using std::size_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <ctime>
export module std:ctime;
export namespace std {
using std::clock_t;
using std::size_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <cuchar>
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 @@ export namespace std {
// 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

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwchar>
#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 @@ export namespace std {
using std::mbsrtowcs;
using std::wcrtomb;
using std::wcsrtombs;
} // namespace std
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
} // namespace std

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwctype>
#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 @@ export namespace std {
using std::towupper;
using std::wctrans;
using std::wctype;
} // namespace std
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <deque>
export module std:deque;
export namespace std {
// [deque], class template deque
using std::deque;

View File

@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <exception>
export module std:exception;
export namespace std {
using std::bad_exception;
using std::current_exception;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <execution>
export module std:execution;
export namespace std {
// [execpol.type], execution policy type trait
using std::is_execution_policy;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <expected>
export module std:expected;
export namespace std {
// [expected.unexpected], class template unexpected
using std::unexpected;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <filesystem>
export module std:filesystem;
export namespace std::filesystem {
// [fs.class.path], paths
using std::filesystem::path;

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<flat_map>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <flat_map>
#endif
export module std:flat_map;
export namespace std {
#if 0
// [flat.map], class template flat_­map

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<flat_set>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <flat_set>
#endif
export module std:flat_set;
export namespace std {
#if 0
// [flat.set], class template flat_­set

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <format>
export module std:format;
export namespace std {
// [format.context], class template basic_format_context
using std::basic_format_context;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <forward_list>
export module std:forward_list;
export namespace std {
// [forward.list], class template forward_list
using std::forward_list;

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <fstream>
#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 @@ export namespace std {
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using std::wfstream;
# endif
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <functional>
export module std:functional;
export namespace std {
// [func.invoke], invoke
using std::invoke;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <future>
export module std:future;
export namespace std {
using std::future_errc;
using std::future_status;

View File

@ -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(<generator>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <generator>
#endif
export module std:generator;
export namespace std {
#if 0
using std::generator;
#endif
} // namespace std

View File

@ -0,0 +1,14 @@
// -*- 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 namespace std {
#if 0
using std::generator;
#endif
} // namespace std

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<hazard_pointer>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <hazard_pointer>
#endif
export module std:hazard_pointer;
export namespace std {
#if 0
# if _LIBCPP_STD_VER >= 23

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <initializer_list>
export module std:initializer_list;
export namespace std {
using std::initializer_list;

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <iomanip>
#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 @@ export namespace std {
using std::setw;
using std::quoted;
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <ios>
#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 @@ export namespace std {
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using std::wios;
# endif
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <iosfwd>
export module std:iosfwd;
export namespace std {
using std::streampos;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <iostream>
#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 @@ export namespace std {
using std::wclog;
using std::wcout;
# endif
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <istream>
#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 @@ export namespace std {
using std::ws;
using std::operator>>;
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <iterator>
export module std:iterator;
export namespace std {
// [iterator.assoc.types], associated types
// [incrementable.traits], incrementable traits

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <latch>
export module std:latch;
export namespace std {
using std::latch;
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <limits>
export module std:limits;
export namespace std {
// [fp.style], floating-point type properties
using std::float_denorm_style;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <list>
export module std:list;
export namespace std {
// [list], class template list
using std::list;

View File

@ -7,14 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
#endif
export module std:locale;
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
export namespace std {
// [locale], locale
using std::has_facet;
@ -80,4 +72,3 @@ export namespace std {
// [depr.conversions.string]
using std::wstring_convert;
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <map>
export module std:map;
export namespace std {
// [map], class template map
using std::map;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <mdspan>
export module std:mdspan;
export namespace std {
// [mdspan.extents], class template extents
using std::extents;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <memory>
export module std:memory;
export namespace std {
// [pointer.traits], pointer traits
using std::pointer_traits;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <memory_resource>
export module std:memory_resource;
export namespace std::pmr {
// [mem.res.class], class memory_resource
using std::pmr::memory_resource;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <mutex>
export module std:mutex;
export namespace std {
// [thread.mutex.class], class mutex
using std::mutex;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <new>
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;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <numbers>
export module std:numbers;
export namespace std::numbers {
using std::numbers::e_v;
using std::numbers::egamma_v;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <numeric>
export module std:numeric;
export namespace std {
// [accumulate], accumulate
using std::accumulate;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <optional>
export module std:optional;
export namespace std {
// [optional.optional], class template optional
using std::optional;

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <ostream>
#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 @@ export namespace std {
using std::vprint_nonunicode;
using std::vprint_unicode;
# endif
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <print>
export module std:print;
export namespace std {
// [print.fun], print functions
using std::print;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <queue>
export module std:queue;
export namespace std {
// [queue], class template queue
using std::queue;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <random>
export module std:random;
export namespace std {
// [rand.req.urng], uniform random bit generator requirements
using std::uniform_random_bit_generator;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <ranges>
export module std:ranges;
export namespace std {
namespace ranges {
inline namespace __cpo {

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <ratio>
export module std:ratio;
export namespace std {
// [ratio.ratio], class template ratio
using std::ratio;

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<rcu>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <rcu>
#endif
export module std:rcu;
export namespace std {
#if 0
# if _LIBCPP_STD_VER >= 23

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <regex>
#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 @@ export namespace std {
using std::pmr::wcmatch;
using std::pmr::wsmatch;
# endif
} // namespace pmr
} // namespace std
} // namespace pmr
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <scoped_allocator>
export module std:scoped_allocator;
export namespace std {
// class template scoped_allocator_adaptor
using std::scoped_allocator_adaptor;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <semaphore>
export module std:semaphore;
export namespace std {
// [thread.sema.cnt], class template counting_semaphore
using std::counting_semaphore;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <set>
export module std:set;
export namespace std {
// [set], class template set
using std::set;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <shared_mutex>
export module std:shared_mutex;
export namespace std {
// [thread.sharedmutex.class], class shared_­mutex
using std::shared_mutex;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <source_location>
export module std:source_location;
export namespace std {
using std::source_location;
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <span>
export module std:span;
export namespace std {
// constants
using std::dynamic_extent;

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<spanstream>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <spanstream>
#endif
export module std:spanstream;
export namespace std {
#if 0
using std::basic_spanbuf;

View File

@ -7,15 +7,8 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <sstream>
#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 @@ export namespace std {
# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using std::wstringstream;
# endif
} // namespace std
#endif // _LIBCPP_HAS_NO_LOCALIZATION
} // namespace std

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <stack>
export module std:stack;
export namespace std {
// [stack], class template stack
using std::stack;

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<stacktrace>)
# error "include this header unconditionally and uncomment the exported symbols"
# include <stacktrace>
#endif
export module std:stacktrace;
export namespace std {
#if 0
// [stacktrace.entry], class stacktrace_­entry

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <stdexcept>
export module std:stdexcept;
export namespace std {
using std::domain_error;
using std::invalid_argument;

View File

@ -7,13 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#if __has_include(<stdfloat>)
# error "include this header unconditionally"
# include <stdfloat>
#endif
export module std:stdfloat;
export namespace std {
#if defined(__STDCPP_FLOAT16_T__)
using std::float16_t;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <stop_token>
export module std:stop_token;
export namespace std {
// [stoptoken], class stop_­token
using std::stop_token;

View File

@ -7,19 +7,12 @@
//
//===----------------------------------------------------------------------===//
module;
#include <__config>
#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <streambuf>
#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

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <string>
export module std:string;
export namespace std {
// [char.traits], character traits
using std::char_traits;

View File

@ -7,10 +7,6 @@
//
//===----------------------------------------------------------------------===//
module;
#include <string_view>
export module std:string_view;
export namespace std {
// [string.view.template], class template basic_string_view
using std::basic_string_view;

Some files were not shown because too many files have changed in this diff Show More