diff --git a/MODULE.bazel b/MODULE.bazel index 82c8bbd5..dc0acc57 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -40,6 +40,7 @@ llvm_project_overlay.configure( "@rules_ll//patches:rules_ll_overlay_patch.diff", "@rules_ll//patches:clang_new_offload_driver.diff", "@rules_ll//patches:llvm_use_zlib-ng.diff", + "@rules_ll//patches:std_modules.diff", ], ) diff --git a/examples/std_module_example/BUILD.bazel b/examples/std_module_example/BUILD.bazel new file mode 100644 index 00000000..c7ec956a --- /dev/null +++ b/examples/std_module_example/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_ll//ll:defs.bzl", "ll_binary") + +ll_binary( + name = "std_module_example", + srcs = ["main.cpp"], + compile_flags = ["-std=c++2b"], + visibility = ["@//:__pkg__"], +) diff --git a/examples/std_module_example/main.cpp b/examples/std_module_example/main.cpp new file mode 100644 index 00000000..a192e6ac --- /dev/null +++ b/examples/std_module_example/main.cpp @@ -0,0 +1,6 @@ +import std; + +auto main() -> int { + std::cout << "Hello, World!" << std::endl; + return 0; +} diff --git a/ll/args.bzl b/ll/args.bzl index d05c48f3..f17ae6b2 100644 --- a/ll/args.bzl +++ b/ll/args.bzl @@ -372,6 +372,13 @@ def compile_object_args( omit_if_empty = True, ) + if ctx.attr.compilation_mode != "bootstrap": + args.add_all( + toolchain.cpp_stdmodules, + map_each = _create_module_import, + format_each = "-fmodule-file=%s", + ) + # Input file. args.add(in_file) diff --git a/ll/inputs.bzl b/ll/inputs.bzl index 45ce394c..0c13062c 100644 --- a/ll/inputs.bzl +++ b/ll/inputs.bzl @@ -69,7 +69,7 @@ def compile_object_inputs( toolchain.unwind_library + toolchain.cpp_abihdrs + toolchain.compiler_runtime - ) + ) + [module.bmi for module in toolchain.cpp_stdmodules] if config == "cpp": pass @@ -120,7 +120,7 @@ def link_executable_inputs(ctx, in_files): ctx.files.deps + ctx.files.libraries + ctx.files.data - ) + ) + [module.bmi for module in toolchain.cpp_stdmodules] if config == "bootstrap": return depset(direct) diff --git a/ll/toolchain.bzl b/ll/toolchain.bzl index e6d39eeb..9229c3ff 100644 --- a/ll/toolchain.bzl +++ b/ll/toolchain.bzl @@ -4,6 +4,7 @@ This file declares the `ll_toolchain` rule. """ load("//ll:attributes.bzl", "LL_TOOLCHAIN_ATTRS") +load("//ll:providers.bzl", "LlInfo") def _ll_toolchain_impl(ctx): # We always need to invoke lld via an ld.lld -> lld symlink. @@ -20,6 +21,10 @@ def _ll_toolchain_impl(ctx): ]) llvm_project_artifacts = ctx.files.llvm_project_deps + std_modules = [] + for target in ctx.attr.cpp_stdlib: + std_modules += target[LlInfo].exposed_bmis.to_list() + return [ platform_common.ToolchainInfo( c_driver = ctx.executable.c_driver, @@ -42,6 +47,7 @@ def _ll_toolchain_impl(ctx): builtin_includes = ctx.files.builtin_includes, cpp_stdlib = ctx.files.cpp_stdlib, cpp_stdhdrs = ctx.files.cpp_stdhdrs, + cpp_stdmodules = std_modules, cpp_abilib = ctx.files.cpp_abilib, cpp_abihdrs = ctx.files.cpp_abihdrs, compiler_runtime = ctx.files.compiler_runtime, diff --git a/llvm-project-overlay/libcxx/BUILD.bazel b/llvm-project-overlay/libcxx/BUILD.bazel index e7afda61..7638ccf0 100644 --- a/llvm-project-overlay/libcxx/BUILD.bazel +++ b/llvm-project-overlay/libcxx/BUILD.bazel @@ -1,6 +1,116 @@ load("@rules_ll//ll:defs.bzl", "ll_library") load("@bazel_skylib//rules:expand_template.bzl", "expand_template") +STD_PARTITIONS = [ + "algorithm", + "any", + "array", + "atomic", + "barrier", + "bit", + "bitset", + "cassert", + "cctype", + "cerrno", + "cfenv", + "cfloat", + "charconv", + "chrono", + "cinttypes", + "climits", + "clocale", + "cmath", + "codecvt", + "compare", + "complex", + "concepts", + "condition_variable", + "coroutine", + "csetjmp", + "csignal", + "cstdarg", + "cstddef", + "cstdio", + "cstdlib", + "cstdint", + "cstring", + "ctime", + "cuchar", + "cwchar", + "cwctype", + "deque", + "exception", + "execution", + "expected", + "filesystem", + "flat_map", + "flat_set", + "format", + "forward_list", + "fstream", + "functional", + "future", + "generator", + "initializer_list", + "iomanip", + "ios", + "iosfwd", + "iostream", + "istream", + "iterator", + "latch", + "limits", + "list", + "locale", + "map", + "mdspan", + "memory", + "memory_resource", + "mutex", + # "new", # Needs special treatment. Module is called __new. + "numbers", + "numeric", + "optional", + "ostream", + "print", + "queue", + "random", + "ranges", + "ratio", + "regex", + "scoped_allocator", + "semaphore", + "set", + "shared_mutex", + "source_location", + "span", + "spanstream", + "sstream", + "stack", + "stacktrace", + "stdexcept", + "stdfloat", + "stop_token", + "streambuf", + "string", + "string_view", + "strstream", + "syncstream", + "system_error", + "thread", + "tuple", + "typeindex", + "typeinfo", + "type_traits", # Manually had to include . + "unordered_map", + "unordered_set", + "utility", + "valarray", + "variant", + "vector", + "version", +] + expand_template( name = "module_modulemap_gen", out = "include/module.modulemap", @@ -152,7 +262,7 @@ ll_library( ], compilation_mode = "bootstrap", compile_flags = [ - "-std=c++20", + "-std=c++2b", "-faligned-allocation", "-fno-omit-frame-pointer", "-funwind-tables", @@ -178,9 +288,18 @@ ll_library( exposed_hdrs = [ "//libcxx:headers", ], + exposed_interfaces = { + "modules/std.cppm": "std", + }, includes = [ "libcxx/src", ], + interfaces = { + "modules/std/{}.cppm".format(name): "std:{}".format(name) + for name in STD_PARTITIONS + } | { + "modules/std/new.cppm": "std:__new", + }, visibility = ["//visibility:public"], deps = ["//libcxxabi"], ) diff --git a/patches/rules_ll_overlay_patch.diff b/patches/rules_ll_overlay_patch.diff index a186108d..7e4c1a12 100644 --- a/patches/rules_ll_overlay_patch.diff +++ b/patches/rules_ll_overlay_patch.diff @@ -1270,13 +1270,123 @@ index 000000000000..8ad56ad46df6 +) diff --git a/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel new file mode 100644 -index 000000000000..e7afda6113b8 +index 000000000000..7638ccf0a29f --- /dev/null +++ b/utils/bazel/llvm-project-overlay/libcxx/BUILD.bazel -@@ -0,0 +1,186 @@ +@@ -0,0 +1,305 @@ +load("@rules_ll//ll:defs.bzl", "ll_library") +load("@bazel_skylib//rules:expand_template.bzl", "expand_template") + ++STD_PARTITIONS = [ ++ "algorithm", ++ "any", ++ "array", ++ "atomic", ++ "barrier", ++ "bit", ++ "bitset", ++ "cassert", ++ "cctype", ++ "cerrno", ++ "cfenv", ++ "cfloat", ++ "charconv", ++ "chrono", ++ "cinttypes", ++ "climits", ++ "clocale", ++ "cmath", ++ "codecvt", ++ "compare", ++ "complex", ++ "concepts", ++ "condition_variable", ++ "coroutine", ++ "csetjmp", ++ "csignal", ++ "cstdarg", ++ "cstddef", ++ "cstdio", ++ "cstdlib", ++ "cstdint", ++ "cstring", ++ "ctime", ++ "cuchar", ++ "cwchar", ++ "cwctype", ++ "deque", ++ "exception", ++ "execution", ++ "expected", ++ "filesystem", ++ "flat_map", ++ "flat_set", ++ "format", ++ "forward_list", ++ "fstream", ++ "functional", ++ "future", ++ "generator", ++ "initializer_list", ++ "iomanip", ++ "ios", ++ "iosfwd", ++ "iostream", ++ "istream", ++ "iterator", ++ "latch", ++ "limits", ++ "list", ++ "locale", ++ "map", ++ "mdspan", ++ "memory", ++ "memory_resource", ++ "mutex", ++ # "new", # Needs special treatment. Module is called __new. ++ "numbers", ++ "numeric", ++ "optional", ++ "ostream", ++ "print", ++ "queue", ++ "random", ++ "ranges", ++ "ratio", ++ "regex", ++ "scoped_allocator", ++ "semaphore", ++ "set", ++ "shared_mutex", ++ "source_location", ++ "span", ++ "spanstream", ++ "sstream", ++ "stack", ++ "stacktrace", ++ "stdexcept", ++ "stdfloat", ++ "stop_token", ++ "streambuf", ++ "string", ++ "string_view", ++ "strstream", ++ "syncstream", ++ "system_error", ++ "thread", ++ "tuple", ++ "typeindex", ++ "typeinfo", ++ "type_traits", # Manually had to include . ++ "unordered_map", ++ "unordered_set", ++ "utility", ++ "valarray", ++ "variant", ++ "vector", ++ "version", ++] ++ +expand_template( + name = "module_modulemap_gen", + out = "include/module.modulemap", @@ -1428,7 +1538,7 @@ index 000000000000..e7afda6113b8 + ], + compilation_mode = "bootstrap", + compile_flags = [ -+ "-std=c++20", ++ "-std=c++2b", + "-faligned-allocation", + "-fno-omit-frame-pointer", + "-funwind-tables", @@ -1454,9 +1564,18 @@ index 000000000000..e7afda6113b8 + exposed_hdrs = [ + "//libcxx:headers", + ], ++ exposed_interfaces = { ++ "modules/std.cppm": "std", ++ }, + includes = [ + "libcxx/src", + ], ++ interfaces = { ++ "modules/std/{}.cppm".format(name): "std:{}".format(name) ++ for name in STD_PARTITIONS ++ } | { ++ "modules/std/new.cppm": "std:__new", ++ }, + visibility = ["//visibility:public"], + deps = ["//libcxxabi"], +) diff --git a/patches/std_modules.diff b/patches/std_modules.diff new file mode 100644 index 00000000..0271f690 --- /dev/null +++ b/patches/std_modules.diff @@ -0,0 +1,8801 @@ +diff --git a/libcxx/include/tuple b/libcxx/include/tuple +index f9e9ff2e51ba..ea86a4118481 100644 +--- a/libcxx/include/tuple ++++ b/libcxx/include/tuple +@@ -1500,9 +1500,10 @@ struct __ignore_t + const __ignore_t& operator=(_Tp&&) const {return *this;} + }; + +-namespace { +- constexpr __ignore_t ignore = __ignore_t(); +-} // namespace ++// SEPARATE REVIEW NEEDS TO USE NEW INLINE CONSTEXPR MACRO ++//namespace { ++ inline constexpr __ignore_t ignore = __ignore_t(); ++//} // namespace + + template + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 +diff --git a/libcxx/modules/std.compat.cppm b/libcxx/modules/std.compat.cppm +new file mode 100644 +index 000000000000..95593c4e7005 +--- /dev/null ++++ b/libcxx/modules/std.compat.cppm +@@ -0,0 +1,34 @@ ++// -*- 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.compat; ++ ++export import std; ++// The headers of Table 25: C++ headers for C library facilities [tab:headers.cpp.c] ++export import :cassert; ++export import :cctype; ++export import :cerrno; ++export import :cfenv; ++export import :cfloat; ++export import :cinttypes; ++export import :climits; ++export import :clocale; ++export import :cmath; ++export import :csetjmp; ++export import :csignal; ++export import :cstdarg; ++export import :cstddef; ++export import :cstdint; ++export import :cstdio; ++export import :cstdlib; ++export import :cstring; ++export import :ctime; ++export import :cuchar; ++export import :cwchar; ++export import :cwctype; +diff --git a/libcxx/modules/std.compat/cassert.cppm b/libcxx/modules/std.compat/cassert.cppm +new file mode 100644 +index 000000000000..95e1bf30333a +--- /dev/null ++++ b/libcxx/modules/std.compat/cassert.cppm +@@ -0,0 +1,16 @@ ++// -*- 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.compat:cassert; ++export { ++ // This module exports nothing. ++} // export +diff --git a/libcxx/modules/std.compat/cctype.cppm b/libcxx/modules/std.compat/cctype.cppm +new file mode 100644 +index 000000000000..5399907208ab +--- /dev/null ++++ b/libcxx/modules/std.compat/cctype.cppm +@@ -0,0 +1,29 @@ ++// -*- 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.compat:cctype; ++export { ++ using ::isalnum; ++ using ::isalpha; ++ using ::isblank; ++ using ::iscntrl; ++ using ::isdigit; ++ using ::isgraph; ++ using ::islower; ++ using ::isprint; ++ using ::ispunct; ++ using ::isspace; ++ using ::isupper; ++ using ::isxdigit; ++ using ::tolower; ++ using ::toupper; ++} // export +diff --git a/libcxx/modules/std.compat/cerrno.cppm b/libcxx/modules/std.compat/cerrno.cppm +new file mode 100644 +index 000000000000..1aafd1fe8bd3 +--- /dev/null ++++ b/libcxx/modules/std.compat/cerrno.cppm +@@ -0,0 +1,16 @@ ++// -*- 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.compat:cerrno; ++export { ++ // This module exports nothing. ++} // export +diff --git a/libcxx/modules/std.compat/cfenv.cppm b/libcxx/modules/std.compat/cfenv.cppm +new file mode 100644 +index 000000000000..84502cc83316 +--- /dev/null ++++ b/libcxx/modules/std.compat/cfenv.cppm +@@ -0,0 +1,34 @@ ++// -*- 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.compat:cfenv; ++export { ++ // types ++ using ::fenv_t; ++ using ::fexcept_t; ++ ++ // functions ++ using ::feclearexcept; ++ using ::fegetexceptflag; ++ using ::feraiseexcept; ++ using ::fesetexceptflag; ++ using ::fetestexcept; ++ ++ using ::fegetround; ++ using ::fesetround; ++ ++ using ::fegetenv; ++ using ::feholdexcept; ++ using ::fesetenv; ++ using ::feupdateenv; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cfloat.cppm b/libcxx/modules/std.compat/cfloat.cppm +new file mode 100644 +index 000000000000..9621bd860513 +--- /dev/null ++++ b/libcxx/modules/std.compat/cfloat.cppm +@@ -0,0 +1,16 @@ ++// -*- 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.compat:cfloat; ++export { ++ // This module exports nothing. ++} // export +diff --git a/libcxx/modules/std.compat/cinttypes.cppm b/libcxx/modules/std.compat/cinttypes.cppm +new file mode 100644 +index 000000000000..18e4c8370514 +--- /dev/null ++++ b/libcxx/modules/std.compat/cinttypes.cppm +@@ -0,0 +1,29 @@ ++// -*- 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.compat:cinttypes; ++export { ++ using ::imaxdiv_t; ++ ++ using ::imaxabs; ++ using ::imaxdiv; ++ using ::strtoimax; ++ using ::strtoumax; ++ using ::wcstoimax; ++ using ::wcstoumax; ++ ++ // abs is conditionally here, but always present in cmath.cppm. To avoid ++ // conflicing declarations omit the using here. ++ ++ // div is conditionally here, but always present in cstdlib.cppm. To avoid ++ // conflicing declarations omit the using here. ++} // export +diff --git a/libcxx/modules/std.compat/climits.cppm b/libcxx/modules/std.compat/climits.cppm +new file mode 100644 +index 000000000000..e4a864d74230 +--- /dev/null ++++ b/libcxx/modules/std.compat/climits.cppm +@@ -0,0 +1,16 @@ ++// -*- 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.compat:climits; ++export { ++ // This module exports nothing. ++} // export +diff --git a/libcxx/modules/std.compat/clocale.cppm b/libcxx/modules/std.compat/clocale.cppm +new file mode 100644 +index 000000000000..0c348cfa3ea0 +--- /dev/null ++++ b/libcxx/modules/std.compat/clocale.cppm +@@ -0,0 +1,25 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std.compat:clocale; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export { ++ using ::lconv; ++ ++ using ::localeconv; ++ using ::setlocale; ++ ++} // export ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std.compat/cmath.cppm b/libcxx/modules/std.compat/cmath.cppm +new file mode 100644 +index 000000000000..685838a0e80e +--- /dev/null ++++ b/libcxx/modules/std.compat/cmath.cppm +@@ -0,0 +1,270 @@ ++// -*- 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.compat:cmath; ++export { ++ using ::acos; ++ using ::acosf; ++ using ::acosl; ++ ++ using ::asin; ++ using ::asinf; ++ using ::asinl; ++ ++ using ::atan; ++ using ::atanf; ++ using ::atanl; ++ ++ using ::atan2; ++ using ::atan2f; ++ using ::atan2l; ++ ++ using ::cos; ++ using ::cosf; ++ using ::cosl; ++ ++ using ::sin; ++ using ::sinf; ++ using ::sinl; ++ ++ using ::tan; ++ using ::tanf; ++ using ::tanl; ++ ++ using ::acosh; ++ using ::acoshf; ++ using ::acoshl; ++ ++ using ::asinh; ++ using ::asinhf; ++ using ::asinhl; ++ ++ using ::atanh; ++ using ::atanhf; ++ using ::atanhl; ++ ++ using ::cosh; ++ using ::coshf; ++ using ::coshl; ++ ++ using ::sinh; ++ using ::sinhf; ++ using ::sinhl; ++ ++ using ::tanh; ++ using ::tanhf; ++ using ::tanhl; ++ ++ using ::exp; ++ using ::expf; ++ using ::expl; ++ ++ using ::exp2; ++ using ::exp2f; ++ using ::exp2l; ++ ++ using ::expm1; ++ using ::expm1f; ++ using ::expm1l; ++ ++ using ::frexp; ++ using ::frexpf; ++ using ::frexpl; ++ ++ using ::ilogb; ++ using ::ilogbf; ++ using ::ilogbl; ++ ++ using ::ldexp; ++ using ::ldexpf; ++ using ::ldexpl; ++ ++ using ::log; ++ using ::logf; ++ using ::logl; ++ ++ using ::log10; ++ using ::log10f; ++ using ::log10l; ++ ++ using ::log1p; ++ using ::log1pf; ++ using ::log1pl; ++ ++ using ::log2; ++ using ::log2f; ++ using ::log2l; ++ ++ using ::logb; ++ using ::logbf; ++ using ::logbl; ++ ++ using ::modf; ++ using ::modff; ++ using ::modfl; ++ ++ using ::scalbn; ++ using ::scalbnf; ++ using ::scalbnl; ++ ++ using ::scalbln; ++ using ::scalblnf; ++ using ::scalblnl; ++ ++ using ::cbrt; ++ using ::cbrtf; ++ using ::cbrtl; ++ ++ // [c.math.abs], absolute values ++ using ::abs; ++ ++ using ::fabs; ++ using ::fabsf; ++ using ::fabsl; ++ ++ using ::hypot; ++ using ::hypotf; ++ using ::hypotl; ++ ++ // [c.math.hypot3], three-dimensional hypotenuse ++ using ::hypot; ++ ++ using ::pow; ++ using ::powf; ++ using ::powl; ++ ++ using ::sqrt; ++ using ::sqrtf; ++ using ::sqrtl; ++ ++ using ::erf; ++ using ::erff; ++ using ::erfl; ++ ++ using ::erfc; ++ using ::erfcf; ++ using ::erfcl; ++ ++ using ::lgamma; ++ using ::lgammaf; ++ using ::lgammal; ++ ++ using ::tgamma; ++ using ::tgammaf; ++ using ::tgammal; ++ ++ using ::ceil; ++ using ::ceilf; ++ using ::ceill; ++ ++ using ::floor; ++ using ::floorf; ++ using ::floorl; ++ ++ using ::nearbyint; ++ using ::nearbyintf; ++ using ::nearbyintl; ++ ++ using ::rint; ++ using ::rintf; ++ using ::rintl; ++ ++ using ::lrint; ++ using ::lrintf; ++ using ::lrintl; ++ ++ using ::llrint; ++ using ::llrintf; ++ using ::llrintl; ++ ++ using ::round; ++ using ::roundf; ++ using ::roundl; ++ ++ using ::lround; ++ using ::lroundf; ++ using ::lroundl; ++ ++ using ::llround; ++ using ::llroundf; ++ using ::llroundl; ++ ++ using ::trunc; ++ using ::truncf; ++ using ::truncl; ++ ++ using ::fmod; ++ using ::fmodf; ++ using ::fmodl; ++ ++ using ::remainder; ++ using ::remainderf; ++ using ::remainderl; ++ ++ using ::remquo; ++ using ::remquof; ++ using ::remquol; ++ ++ using ::copysign; ++ using ::copysignf; ++ using ::copysignl; ++ ++ using ::nan; ++ using ::nanf; ++ using ::nanl; ++ ++ using ::nextafter; ++ using ::nextafterf; ++ using ::nextafterl; ++ ++ using ::nexttoward; ++ using ::nexttowardf; ++ using ::nexttowardl; ++ ++ using ::fdim; ++ using ::fdimf; ++ using ::fdiml; ++ ++ using ::fmax; ++ using ::fmaxf; ++ using ::fmaxl; ++ ++ using ::fmin; ++ using ::fminf; ++ using ::fminl; ++ ++ using ::fma; ++ using ::fmaf; ++ using ::fmal; ++ ++ // [c.math.lerp], linear interpolation ++ // [support.c.headers.other]/1 ++ // ... placed within the global namespace scope, except for the functions ++ // described in [sf.cmath], the std::lerp function overloads ([c.math.lerp]) ++ // ... ++ ++ // [c.math.fpclass], classification / comparison functions ++ using ::fpclassify; ++ using ::isfinite; ++ using ::isgreater; ++ using ::isgreaterequal; ++ using ::isinf; ++ using ::isless; ++ using ::islessequal; ++ using ::islessgreater; ++ using ::isnan; ++ using ::isnormal; ++ using ::isunordered; ++ using ::signbit; ++ ++ // [sf.cmath], mathematical special functions ++} // export +diff --git a/libcxx/modules/std.compat/csetjmp.cppm b/libcxx/modules/std.compat/csetjmp.cppm +new file mode 100644 +index 000000000000..597f2e3c6e4e +--- /dev/null ++++ b/libcxx/modules/std.compat/csetjmp.cppm +@@ -0,0 +1,17 @@ ++// -*- 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.compat:csetjmp; ++export { ++ using ::jmp_buf; ++ using ::longjmp; ++} // export +diff --git a/libcxx/modules/std.compat/csignal.cppm b/libcxx/modules/std.compat/csignal.cppm +new file mode 100644 +index 000000000000..b3ef3f5213dc +--- /dev/null ++++ b/libcxx/modules/std.compat/csignal.cppm +@@ -0,0 +1,22 @@ ++// -*- 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.compat:csignal; ++export { ++ using ::sig_atomic_t; ++ ++ // [support.signal], signal handlers ++ using ::signal; ++ ++ using ::raise; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cstdarg.cppm b/libcxx/modules/std.compat/cstdarg.cppm +new file mode 100644 +index 000000000000..2fb633eca079 +--- /dev/null ++++ b/libcxx/modules/std.compat/cstdarg.cppm +@@ -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 ++// ++//===----------------------------------------------------------------------===// ++ ++module; ++#include ++ ++export module std.compat:cstdarg; ++export { using ::va_list; } // export +diff --git a/libcxx/modules/std.compat/cstddef.cppm b/libcxx/modules/std.compat/cstddef.cppm +new file mode 100644 +index 000000000000..8379e8e40a25 +--- /dev/null ++++ b/libcxx/modules/std.compat/cstddef.cppm +@@ -0,0 +1,26 @@ ++// -*- 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.compat:cstddef; ++export { ++ using std::max_align_t; ++ using std::nullptr_t; ++ using std::ptrdiff_t; ++ using std::size_t; ++ ++ // [support.c.headers]/1 ++ // ... placed within the global namespace scope, except for ... the ++ // declaration of std::byte ([cstddef.syn]), and the functions and ++ // function templates described in [support.types.byteops]. ... ++ ++ // [support.types.byteops], byte type operations ++} // export +diff --git a/libcxx/modules/std.compat/cstdint.cppm b/libcxx/modules/std.compat/cstdint.cppm +new file mode 100644 +index 000000000000..59e889e35263 +--- /dev/null ++++ b/libcxx/modules/std.compat/cstdint.cppm +@@ -0,0 +1,57 @@ ++// -*- 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.compat:cstdint; ++export { ++ // validate the list against the proper C standard ++ ++ // signed ++ using ::int8_t _LIBCPP_USING_IF_EXISTS; ++ using ::int16_t _LIBCPP_USING_IF_EXISTS; ++ using ::int32_t _LIBCPP_USING_IF_EXISTS; ++ using ::int64_t _LIBCPP_USING_IF_EXISTS; ++ ++ using ::int_fast16_t; ++ using ::int_fast32_t; ++ using ::int_fast64_t; ++ using ::int_fast8_t; ++ ++ using ::int_least16_t; ++ using ::int_least32_t; ++ using ::int_least64_t; ++ using ::int_least8_t; ++ ++ using ::intmax_t; ++ ++ using ::intptr_t _LIBCPP_USING_IF_EXISTS; ++ ++ // unsigned ++ using ::uint8_t _LIBCPP_USING_IF_EXISTS; ++ using ::uint16_t _LIBCPP_USING_IF_EXISTS; ++ using ::uint32_t _LIBCPP_USING_IF_EXISTS; ++ using ::uint64_t _LIBCPP_USING_IF_EXISTS; ++ ++ using ::uint_fast16_t; ++ using ::uint_fast32_t; ++ using ::uint_fast64_t; ++ using ::uint_fast8_t; ++ ++ using ::uint_least16_t; ++ using ::uint_least32_t; ++ using ::uint_least64_t; ++ using ::uint_least8_t; ++ ++ using ::uintmax_t; ++ ++ using ::uintptr_t _LIBCPP_USING_IF_EXISTS; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cstdio.cppm b/libcxx/modules/std.compat/cstdio.cppm +new file mode 100644 +index 000000000000..4bb03fae275e +--- /dev/null ++++ b/libcxx/modules/std.compat/cstdio.cppm +@@ -0,0 +1,65 @@ ++// -*- 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.compat:cstdio; ++export { ++ using ::FILE; ++ using ::fpos_t; ++ using ::size_t; ++ ++ using ::clearerr; ++ using ::fclose; ++ using ::feof; ++ using ::ferror; ++ using ::fflush; ++ using ::fgetc; ++ using ::fgetpos; ++ using ::fgets; ++ using ::fopen; ++ using ::fprintf; ++ using ::fputc; ++ using ::fputs; ++ using ::fread; ++ using ::freopen; ++ using ::fscanf; ++ using ::fseek; ++ using ::fsetpos; ++ using ::ftell; ++ using ::fwrite; ++ using ::getc; ++ using ::getchar; ++ using ::perror; ++ using ::printf; ++ using ::putc; ++ using ::putchar; ++ using ::puts; ++ using ::remove; ++ using ::rename; ++ using ::rewind; ++ using ::scanf; ++ using ::setbuf; ++ using ::setvbuf; ++ using ::snprintf; ++ using ::sprintf; ++ using ::sscanf; ++ using ::tmpfile; ++ using ::tmpnam; ++ using ::ungetc; ++ using ::vfprintf; ++ using ::vfscanf; ++ using ::vprintf; ++ using ::vscanf; ++ using ::vsnprintf; ++ using ::vsprintf; ++ using ::vsscanf; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cstdlib.cppm b/libcxx/modules/std.compat/cstdlib.cppm +new file mode 100644 +index 000000000000..7209ac70690c +--- /dev/null ++++ b/libcxx/modules/std.compat/cstdlib.cppm +@@ -0,0 +1,76 @@ ++// -*- 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.compat:cstdlib; ++export { ++ using ::div_t; ++ using ::ldiv_t; ++ using ::lldiv_t; ++ using ::size_t; ++ ++ // [support.start.term], start and termination ++ using ::_Exit; ++ using ::abort; ++ using ::at_quick_exit; ++ using ::atexit; ++ using ::exit; ++ using ::quick_exit; ++ ++ using ::getenv; ++ using ::system; ++ ++ // [c.malloc], C library memory allocation ++ using ::aligned_alloc; ++ using ::calloc; ++ using ::free; ++ using ::malloc; ++ using ::realloc; ++ ++ using ::atof; ++ using ::atoi; ++ using ::atol; ++ using ::atoll; ++ using ::strtod; ++ using ::strtof; ++ using ::strtol; ++ using ::strtold; ++ using ::strtoll; ++ using ::strtoul; ++ using ::strtoull; ++ ++ // [c.mb.wcs], multibyte / wide string and character conversion functions ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using ::mblen; ++ using ::mbstowcs; ++ using ::mbtowc; ++ using ::wcstombs; ++ using ::wctomb; ++#endif ++ // [alg.c.library], C standard library algorithms ++ using ::bsearch; ++ using ::qsort; ++ ++ // [c.math.rand], low-quality random number generation ++ using ::rand; ++ using ::srand; ++ ++ // [c.math.abs], absolute values ++ using ::abs; ++ ++ using ::labs; ++ using ::llabs; ++ ++ using ::div; ++ using ::ldiv; ++ using ::lldiv; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cstring.cppm b/libcxx/modules/std.compat/cstring.cppm +new file mode 100644 +index 000000000000..63e30f65b4fa +--- /dev/null ++++ b/libcxx/modules/std.compat/cstring.cppm +@@ -0,0 +1,40 @@ ++// -*- 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.compat:cstring; ++export { ++ using ::size_t; ++ ++ using ::memchr; ++ using ::memcmp; ++ using ::memcpy; ++ using ::memmove; ++ using ::memset; ++ using ::strcat; ++ using ::strchr; ++ using ::strcmp; ++ using ::strcoll; ++ using ::strcpy; ++ using ::strcspn; ++ using ::strerror; ++ using ::strlen; ++ using ::strncat; ++ using ::strncmp; ++ using ::strncpy; ++ using ::strpbrk; ++ using ::strrchr; ++ using ::strspn; ++ using ::strstr; ++ using ::strtok; ++ using ::strxfrm; ++ ++} // export +diff --git a/libcxx/modules/std.compat/ctime.cppm b/libcxx/modules/std.compat/ctime.cppm +new file mode 100644 +index 000000000000..cba8187f9d0c +--- /dev/null ++++ b/libcxx/modules/std.compat/ctime.cppm +@@ -0,0 +1,33 @@ ++// -*- 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.compat:ctime; ++export { ++ using ::clock_t; ++ using ::size_t; ++ using ::time_t; ++ ++ using ::timespec; ++ using ::tm; ++ ++ using ::asctime; ++ using ::clock; ++ using ::ctime; ++ using ::difftime; ++ using ::gmtime; ++ using ::localtime; ++ using ::mktime; ++ using ::strftime; ++ using ::time; ++ using ::timespec_get; ++ ++} // export +diff --git a/libcxx/modules/std.compat/cuchar.cppm b/libcxx/modules/std.compat/cuchar.cppm +new file mode 100644 +index 000000000000..ebd5a40c95a2 +--- /dev/null ++++ b/libcxx/modules/std.compat/cuchar.cppm +@@ -0,0 +1,30 @@ ++// -*- 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.compat:cuchar; ++export { ++ // Note the Standard does not mark these symbols optional, but libc++'s header ++ // does. So this seems strictly not to be conforming. ++ ++ // mbstate_t is conditionally here, but always present in cwchar.cppm. To avoid ++ // conflicing declarations omit the using here. ++ ++ // size_t is conditionally here, but always present in cstddef.cppm. To avoid ++ // conflicing declarations omit the using here. ++ ++ using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS; ++ using ::c8rtomb _LIBCPP_USING_IF_EXISTS; ++ using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS; ++ using ::c16rtomb _LIBCPP_USING_IF_EXISTS; ++ using ::mbrtoc32 _LIBCPP_USING_IF_EXISTS; ++ using ::c32rtomb _LIBCPP_USING_IF_EXISTS; ++} // export +diff --git a/libcxx/modules/std.compat/cwchar.cppm b/libcxx/modules/std.compat/cwchar.cppm +new file mode 100644 +index 000000000000..fdf0b12f766f +--- /dev/null ++++ b/libcxx/modules/std.compat/cwchar.cppm +@@ -0,0 +1,88 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++# include ++#endif ++ ++export module std.compat:cwchar; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++export { ++ using ::mbstate_t; ++ using ::size_t; ++ using ::wint_t; ++ ++ using ::tm; ++ ++ using ::btowc; ++ using ::fgetwc; ++ using ::fgetws; ++ using ::fputwc; ++ using ::fputws; ++ using ::fwide; ++ using ::fwprintf; ++ using ::fwscanf; ++ using ::getwc; ++ using ::getwchar; ++ using ::putwc; ++ using ::putwchar; ++ using ::swprintf; ++ using ::swscanf; ++ using ::ungetwc; ++ using ::vfwprintf; ++ using ::vfwscanf; ++ using ::vswprintf; ++ using ::vswscanf; ++ using ::vwprintf; ++ using ::vwscanf; ++ using ::wcscat; ++ using ::wcschr; ++ using ::wcscmp; ++ using ::wcscoll; ++ using ::wcscpy; ++ using ::wcscspn; ++ using ::wcsftime; ++ using ::wcslen; ++ using ::wcsncat; ++ using ::wcsncmp; ++ using ::wcsncpy; ++ using ::wcspbrk; ++ using ::wcsrchr; ++ using ::wcsspn; ++ using ::wcsstr; ++ using ::wcstod; ++ using ::wcstof; ++ using ::wcstok; ++ using ::wcstol; ++ using ::wcstold; ++ using ::wcstoll; ++ using ::wcstoul; ++ using ::wcstoull; ++ using ::wcsxfrm; ++ using ::wctob; ++ using ::wmemchr; ++ using ::wmemcmp; ++ using ::wmemcpy; ++ using ::wmemmove; ++ using ::wmemset; ++ using ::wprintf; ++ using ::wscanf; ++ ++ // [c.mb.wcs], multibyte / wide string and character conversion functions ++ using ::mbrlen; ++ using ::mbrtowc; ++ using ::mbsinit; ++ using ::mbsrtowcs; ++ using ::wcrtomb; ++ using ::wcsrtombs; ++ ++} // export ++#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +diff --git a/libcxx/modules/std.compat/cwctype.cppm b/libcxx/modules/std.compat/cwctype.cppm +new file mode 100644 +index 000000000000..7229620f403e +--- /dev/null ++++ b/libcxx/modules/std.compat/cwctype.cppm +@@ -0,0 +1,43 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++# include ++#endif ++ ++export module std.compat:cwctype; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++export { ++ using ::wctrans_t; ++ using ::wctype_t; ++ using ::wint_t; ++ ++ using ::iswalnum; ++ using ::iswalpha; ++ using ::iswblank; ++ using ::iswcntrl; ++ using ::iswctype; ++ using ::iswdigit; ++ using ::iswgraph; ++ using ::iswlower; ++ using ::iswprint; ++ using ::iswpunct; ++ using ::iswspace; ++ using ::iswupper; ++ using ::iswxdigit; ++ using ::towctrans; ++ using ::towlower; ++ using ::towupper; ++ using ::wctrans; ++ using ::wctype; ++ ++} // export ++#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +diff --git a/libcxx/modules/std.cppm b/libcxx/modules/std.cppm +new file mode 100644 +index 000000000000..d01e167169e5 +--- /dev/null ++++ b/libcxx/modules/std.cppm +@@ -0,0 +1,120 @@ ++// -*- 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 :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 :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 :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/algorithm.cppm b/libcxx/modules/std/algorithm.cppm +new file mode 100644 +index 000000000000..7c3fb282900d +--- /dev/null ++++ b/libcxx/modules/std/algorithm.cppm +@@ -0,0 +1,621 @@ ++// -*- 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:algorithm; ++export namespace std { ++ namespace ranges { ++ // [algorithms.results], algorithm result types ++ using std::ranges::in_found_result; ++ using std::ranges::in_fun_result; ++ using std::ranges::in_in_out_result; ++ using std::ranges::in_in_result; ++ using std::ranges::in_out_out_result; ++ using std::ranges::in_out_result; ++ // using std::ranges::in_value_result; NOT IMPLEMENTED YET ++ using std::ranges::min_max_result; ++ // using std::ranges::out_value_result; NOT IMPLEMENTED YET ++ } // namespace ranges ++ ++ // [alg.nonmodifying], non-modifying sequence operations ++ // [alg.all.of], all of ++ using std::all_of; ++ namespace ranges { ++ using std::ranges::all_of; ++ } ++ ++ // [alg.any.of], any of ++ using std::any_of; ++ namespace ranges { ++ using std::ranges::any_of; ++ } ++ ++ // [alg.none.of], none of ++ using std::none_of; ++ namespace ranges { ++ using std::ranges::none_of; ++ } ++ ++ // [alg.contains], contains ++#if 0 ++ namespace ranges { ++ using std::ranges::contains; ++ using std::ranges::contains_subrange; ++ } // namespace ranges ++#endif ++ ++ // [alg.foreach], for each ++ using std::for_each; ++ ++ namespace ranges { ++ using std::ranges::for_each; ++ using std::ranges::for_each_result; ++ } // namespace ranges ++ ++ using std::for_each_n; ++ ++ namespace ranges { ++ using std::ranges::for_each_n_result; ++ ++ using std::ranges::for_each_n; ++ } // namespace ranges ++ ++ // [alg.find], find ++ using std::find; ++ using std::find_if; ++ using std::find_if_not; ++ ++ namespace ranges { ++ using std::ranges::find; ++ using std::ranges::find_if; ++ using std::ranges::find_if_not; ++ } // namespace ranges ++ ++ namespace ranges { ++#if 0 ++ using std::ranges::find_last; ++ using std::ranges::find_last_if; ++ using std::ranges::find_last_if_not; ++#endif ++ } // namespace ranges ++ ++ // [alg.find.end], find end ++ using std::find_end; ++ ++ namespace ranges { ++ using std::ranges::find_end; ++ } ++ ++ // [alg.find.first.of], find first ++ using std::find_first_of; ++ ++ namespace ranges { ++ using std::ranges::find_first_of; ++ } ++ ++ // [alg.adjacent.find], adjacent find ++ using std::adjacent_find; ++ ++ namespace ranges { ++ using std::ranges::adjacent_find; ++ } ++ ++ // [alg.count], count ++ using std::count; ++ using std::count_if; ++ ++ namespace ranges { ++ using std::ranges::count; ++ using std::ranges::count_if; ++ } // namespace ranges ++ ++ // [mismatch], mismatch ++ using std::mismatch; ++ ++ namespace ranges { ++ using std::ranges::mismatch_result; ++ ++ using std::ranges::mismatch; ++ } // namespace ranges ++ ++ // [alg.equal], equal ++ using std::equal; ++ ++ namespace ranges { ++ using std::ranges::equal; ++ } ++ ++ // [alg.is.permutation], is permutation ++ using std::is_permutation; ++ ++ namespace ranges { ++ using std::ranges::is_permutation; ++ } ++ ++ // [alg.search], search ++ using std::search; ++ ++ namespace ranges { ++ using std::ranges::search; ++ } ++ ++ using std::search_n; ++ ++ namespace ranges { ++ using std::ranges::search_n; ++ } ++ ++ namespace ranges { ++#if 0 ++ // [alg.starts.with], starts with ++ using std::ranges::starts_with; ++ ++ // [alg.ends.with], ends with ++ using std::ranges::ends_with; ++ ++ // [alg.fold], fold ++ using std::ranges::fold_left; ++ using std::ranges::fold_left_first; ++ using std::ranges::fold_right; ++ using std::ranges::fold_right_last; ++ using std::ranges::fold_left_with_iter; ++ using std::ranges::fold_left_with_iter_result; ++ using std::ranges::fold_left_with_iter; ++ using std::ranges::fold_left_first_with_iter; ++ using std::ranges::fold_left_first_with_iter; ++#endif ++ } // namespace ranges ++ ++ // [alg.modifying.operations], mutating sequence operations ++ // [alg.copy], copy ++ using std::copy; ++ ++ namespace ranges { ++ using std::ranges::copy; ++ using std::ranges::copy_result; ++ } // namespace ranges ++ ++ using std::copy_n; ++ ++ namespace ranges { ++ using std::ranges::copy_n; ++ using std::ranges::copy_n_result; ++ } // namespace ranges ++ ++ using std::copy_if; ++ ++ namespace ranges { ++ using std::ranges::copy_if; ++ using std::ranges::copy_if_result; ++ } // namespace ranges ++ ++ using std::copy_backward; ++ ++ namespace ranges { ++ using std::ranges::copy_backward; ++ using std::ranges::copy_backward_result; ++ } // namespace ranges ++ ++ // [alg.move], move ++ using std::move; ++ ++ namespace ranges { ++ using std::ranges::move; ++ using std::ranges::move_result; ++ } // namespace ranges ++ ++ using std::move_backward; ++ ++ namespace ranges { ++ using std::ranges::move_backward; ++ using std::ranges::move_backward_result; ++ } // namespace ranges ++ ++ // [alg.swap], swap ++ using std::swap_ranges; ++ ++ namespace ranges { ++ using std::ranges::swap_ranges; ++ using std::ranges::swap_ranges_result; ++ } // namespace ranges ++ ++ using std::iter_swap; ++ ++ // [alg.transform], transform ++ using std::transform; ++ ++ namespace ranges { ++ using std::ranges::binary_transform_result; ++ using std::ranges::unary_transform_result; ++ ++ using std::ranges::transform; ++ ++ } // namespace ranges ++ ++ using std::replace; ++ using std::replace_if; ++ ++ namespace ranges { ++ using std::ranges::replace; ++ using std::ranges::replace_if; ++ } // namespace ranges ++ ++ using std::replace_copy; ++ using std::replace_copy_if; ++ ++ namespace ranges { ++ using std::ranges::replace_copy; ++ using std::ranges::replace_copy_if; ++ using std::ranges::replace_copy_if_result; ++ using std::ranges::replace_copy_result; ++ } // namespace ranges ++ ++ // [alg.fill], fill ++ using std::fill; ++ using std::fill_n; ++ ++ namespace ranges { ++ using std::ranges::fill; ++ using std::ranges::fill_n; ++ } // namespace ranges ++ ++ // [alg.generate], generate ++ using std::generate; ++ using std::generate_n; ++ ++ namespace ranges { ++ using std::ranges::generate; ++ using std::ranges::generate_n; ++ } // namespace ranges ++ ++ // [alg.remove], remove ++ using std::remove; ++ using std::remove_if; ++ ++ namespace ranges { ++ using std::ranges::remove; ++ using std::ranges::remove_if; ++ } // namespace ranges ++ ++ using std::remove_copy; ++ using std::remove_copy_if; ++ namespace ranges { ++ using std::ranges::remove_copy; ++ using std::ranges::remove_copy_if; ++ using std::ranges::remove_copy_if_result; ++ using std::ranges::remove_copy_result; ++ } // namespace ranges ++ ++ // [alg.unique], unique ++ using std::unique; ++ ++ namespace ranges { ++ using std::ranges::unique; ++ } ++ ++ using std::unique_copy; ++ ++ namespace ranges { ++ using std::ranges::unique_copy; ++ using std::ranges::unique_copy_result; ++ } // namespace ranges ++ ++ // [alg.reverse], reverse ++ using std::reverse; ++ ++ namespace ranges { ++ using std::ranges::reverse; ++ } ++ ++ using std::reverse_copy; ++ ++ namespace ranges { ++ using std::ranges::reverse_copy; ++ using std::ranges::reverse_copy_result; ++ } // namespace ranges ++ ++ // [alg.rotate], rotate ++ using std::rotate; ++ ++ namespace ranges { ++ using std::ranges::rotate; ++ } ++ ++ using std::rotate_copy; ++ ++ namespace ranges { ++ using std::ranges::rotate_copy; ++ using std::ranges::rotate_copy_result; ++ } // namespace ranges ++ ++ // [alg.random.sample], sample ++ using std::sample; ++ ++ namespace ranges { ++ using std::ranges::sample; ++ } ++ ++ // [alg.random.shuffle], shuffle ++ using std::shuffle; ++ ++ namespace ranges { ++ using std::ranges::shuffle; ++ } ++ ++ // [alg.shift], shift ++ using std::shift_left; ++ ++ namespace ranges { ++ // using std::ranges::shift_left; NOT IMPLEMENTED YET ++ } ++ ++ using std::shift_right; ++ ++ namespace ranges { ++ // using std::ranges::shift_right; NOT IMPLEMENTED YET ++ } ++ ++ // [alg.sorting], sorting and related operations ++ // [alg.sort], sorting ++ using std::sort; ++ ++ namespace ranges { ++ using std::ranges::sort; ++ } ++ ++ using std::stable_sort; ++ ++ namespace ranges { ++ using std::ranges::stable_sort; ++ } ++ ++ using std::partial_sort; ++ ++ namespace ranges { ++ using std::ranges::partial_sort; ++ } ++ using std::partial_sort_copy; ++ ++ namespace ranges { ++ using std::ranges::partial_sort_copy; ++ using std::ranges::partial_sort_copy_result; ++ } // namespace ranges ++ ++ using std::is_sorted; ++ using std::is_sorted_until; ++ ++ namespace ranges { ++ using std::ranges::is_sorted; ++ using std::ranges::is_sorted_until; ++ } // namespace ranges ++ ++ // [alg.nth.element], Nth element ++ using std::nth_element; ++ ++ namespace ranges { ++ using std::ranges::nth_element; ++ } ++ ++ // [alg.binary.search], binary search ++ using std::lower_bound; ++ ++ namespace ranges { ++ using std::ranges::lower_bound; ++ } ++ ++ using std::upper_bound; ++ ++ namespace ranges { ++ using std::ranges::upper_bound; ++ } ++ ++ using std::equal_range; ++ ++ namespace ranges { ++ using std::ranges::equal_range; ++ } ++ ++ using std::binary_search; ++ ++ namespace ranges { ++ using std::ranges::binary_search; ++ } ++ ++ // [alg.partitions], partitions ++ using std::is_partitioned; ++ ++ namespace ranges { ++ using std::ranges::is_partitioned; ++ } ++ ++ using std::partition; ++ ++ namespace ranges { ++ using std::ranges::partition; ++ } ++ ++ using std::stable_partition; ++ ++ namespace ranges { ++ using std::ranges::stable_partition; ++ } ++ ++ using std::partition_copy; ++ ++ namespace ranges { ++ using std::ranges::partition_copy; ++ using std::ranges::partition_copy_result; ++ } // namespace ranges ++ ++ using std::partition_point; ++ ++ namespace ranges { ++ using std::ranges::partition_point; ++ } ++ // [alg.merge], merge ++ using std::merge; ++ namespace ranges { ++ using std::ranges::merge; ++ using std::ranges::merge_result; ++ } // namespace ranges ++ ++ using std::inplace_merge; ++ ++ namespace ranges { ++ using std::ranges::inplace_merge; ++ } ++ ++ // [alg.set.operations], set operations ++ using std::includes; ++ namespace ranges { ++ using std::ranges::includes; ++ } ++ ++ using std::set_union; ++ ++ namespace ranges { ++ using std::ranges::set_union; ++ using std::ranges::set_union_result; ++ } // namespace ranges ++ ++ using std::set_intersection; ++ namespace ranges { ++ using std::ranges::set_intersection; ++ using std::ranges::set_intersection_result; ++ } // namespace ranges ++ ++ using std::set_difference; ++ ++ namespace ranges { ++ using std::ranges::set_difference; ++ using std::ranges::set_difference_result; ++ } // namespace ranges ++ ++ using std::set_symmetric_difference; ++ ++ namespace ranges { ++ using std::ranges::set_symmetric_difference_result; ++ ++ using std::ranges::set_symmetric_difference; ++ } // namespace ranges ++ ++ // [alg.heap.operations], heap operations ++ using std::push_heap; ++ ++ namespace ranges { ++ using std::ranges::push_heap; ++ } ++ ++ using std::pop_heap; ++ ++ namespace ranges { ++ using std::ranges::pop_heap; ++ } ++ ++ using std::make_heap; ++ ++ namespace ranges { ++ using std::ranges::make_heap; ++ } ++ ++ using std::sort_heap; ++ ++ namespace ranges { ++ using std::ranges::sort_heap; ++ } ++ ++ using std::is_heap; ++ ++ namespace ranges { ++ using std::ranges::is_heap; ++ } ++ ++ using std::is_heap_until; ++ ++ namespace ranges { ++ using std::ranges::is_heap_until; ++ } ++ ++ // [alg.min.max], minimum and maximum ++ using std::min; ++ ++ namespace ranges { ++ using std::ranges::min; ++ } ++ ++ using std::max; ++ ++ namespace ranges { ++ using std::ranges::max; ++ } ++ ++ using std::minmax; ++ ++ namespace ranges { ++ using std::ranges::minmax_result; ++ ++ using std::ranges::minmax; ++ } // namespace ranges ++ ++ using std::min_element; ++ ++ namespace ranges { ++ using std::ranges::min_element; ++ } ++ ++ using std::max_element; ++ ++ namespace ranges { ++ using std::ranges::max_element; ++ } ++ ++ using std::minmax_element; ++ ++ namespace ranges { ++ using std::ranges::minmax_element_result; ++ ++ using std::ranges::minmax_element; ++ } // namespace ranges ++ // [alg.clamp], bounded value ++ using std::clamp; ++ ++ namespace ranges { ++ using std::ranges::clamp; ++ } ++ ++ // [alg.lex.comparison], lexicographical comparison ++ using std::lexicographical_compare; ++ ++ namespace ranges { ++ using std::ranges::lexicographical_compare; ++ } ++ ++ // [alg.three.way], three-way comparison algorithms ++ using std::lexicographical_compare_three_way; ++ ++ // [alg.permutation.generators], permutations ++ using std::next_permutation; ++ ++ namespace ranges { ++ using std::ranges::next_permutation_result; ++ ++ using std::ranges::next_permutation; ++ } // namespace ranges ++ ++ using std::prev_permutation; ++ ++ namespace ranges { ++ using std::ranges::prev_permutation_result; ++ ++ using std::ranges::prev_permutation; ++ } // namespace ranges ++ ++} // namespace std +diff --git a/libcxx/modules/std/any.cppm b/libcxx/modules/std/any.cppm +new file mode 100644 +index 000000000000..f44f4da4ed64 +--- /dev/null ++++ b/libcxx/modules/std/any.cppm +@@ -0,0 +1,27 @@ ++// -*- 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:any; ++export namespace std { ++ ++ // [any.bad.any.cast], class bad_any_cast ++ using std::bad_any_cast; ++ ++ // [any.class], class any ++ using std::any; ++ ++ // [any.nonmembers], non-member functions ++ using std::any_cast; ++ using std::make_any; ++ using std::swap; ++ ++} // namespace std +diff --git a/libcxx/modules/std/array.cppm b/libcxx/modules/std/array.cppm +new file mode 100644 +index 000000000000..4a7321b656ce +--- /dev/null ++++ b/libcxx/modules/std/array.cppm +@@ -0,0 +1,41 @@ ++// -*- 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:array; ++export namespace std { ++ ++ // [array], class template array ++ using std::array; ++ ++ using std::operator==; ++#if 0 // P1614 ++ using std::operator<=>; ++#else ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#endif ++ ++ // [array.special], specialized algorithms ++ using std::swap; ++ ++ // [array.creation], array creation functions ++ using std::to_array; ++ ++ // [array.tuple], tuple interface ++ using std::get; ++ using std::tuple_element; ++ using std::tuple_size; ++ ++} // namespace std +diff --git a/libcxx/modules/std/atomic.cppm b/libcxx/modules/std/atomic.cppm +new file mode 100644 +index 000000000000..117c8b29675a +--- /dev/null ++++ b/libcxx/modules/std/atomic.cppm +@@ -0,0 +1,146 @@ ++// -*- 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:atomic; ++export namespace std { ++ ++ // [atomics.order], order and consistency ++ using std::memory_order; ++ using std::memory_order_acq_rel; ++ using std::memory_order_acquire; ++ using std::memory_order_consume; ++ using std::memory_order_relaxed; ++ using std::memory_order_release; ++ using std::memory_order_seq_cst; ++ ++ using std::kill_dependency; ++} // namespace std ++ ++namespace std { ++ ++ // [atomics.ref.generic], class template atomic_ref ++ // [atomics.ref.pointer], partial specialization for pointers ++ // using std::atomic_ref; ++ ++ // [atomics.types.generic], class template atomic ++ using std::atomic; ++ ++ // [atomics.nonmembers], non-member functions ++ using std::atomic_compare_exchange_strong; ++ using std::atomic_compare_exchange_strong_explicit; ++ using std::atomic_compare_exchange_weak; ++ using std::atomic_compare_exchange_weak_explicit; ++ using std::atomic_exchange; ++ using std::atomic_exchange_explicit; ++ using std::atomic_is_lock_free; ++ using std::atomic_load; ++ using std::atomic_load_explicit; ++ using std::atomic_store; ++ using std::atomic_store_explicit; ++ ++ using std::atomic_fetch_add; ++ using std::atomic_fetch_add_explicit; ++ using std::atomic_fetch_and; ++ using std::atomic_fetch_and_explicit; ++ using std::atomic_fetch_or; ++ using std::atomic_fetch_or_explicit; ++ using std::atomic_fetch_sub; ++ using std::atomic_fetch_sub_explicit; ++ using std::atomic_fetch_xor; ++ using std::atomic_fetch_xor_explicit; ++ using std::atomic_notify_all; ++ using std::atomic_notify_one; ++ using std::atomic_wait; ++ using std::atomic_wait_explicit; ++ ++ // [atomics.alias], type aliases ++ using std::atomic_bool; ++ using std::atomic_char; ++ using std::atomic_char16_t; ++ using std::atomic_char32_t; ++ using std::atomic_char8_t; ++ using std::atomic_int; ++ using std::atomic_llong; ++ using std::atomic_long; ++ using std::atomic_schar; ++ using std::atomic_short; ++ using std::atomic_uchar; ++ using std::atomic_uint; ++ using std::atomic_ullong; ++ using std::atomic_ulong; ++ using std::atomic_ushort; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::atomic_wchar_t; ++#endif ++ ++ using std::atomic_int16_t; ++ using std::atomic_int32_t; ++ using std::atomic_int64_t; ++ using std::atomic_int8_t; ++ using std::atomic_uint16_t; ++ using std::atomic_uint32_t; ++ using std::atomic_uint64_t; ++ using std::atomic_uint8_t; ++ ++ using std::atomic_int_least16_t; ++ using std::atomic_int_least32_t; ++ using std::atomic_int_least64_t; ++ using std::atomic_int_least8_t; ++ using std::atomic_uint_least16_t; ++ using std::atomic_uint_least32_t; ++ using std::atomic_uint_least64_t; ++ using std::atomic_uint_least8_t; ++ ++ using std::atomic_int_fast16_t; ++ using std::atomic_int_fast32_t; ++ using std::atomic_int_fast64_t; ++ using std::atomic_int_fast8_t; ++ using std::atomic_uint_fast16_t; ++ using std::atomic_uint_fast32_t; ++ using std::atomic_uint_fast64_t; ++ using std::atomic_uint_fast8_t; ++ ++ using std::atomic_intmax_t; ++ using std::atomic_intptr_t; ++ using std::atomic_ptrdiff_t; ++ using std::atomic_size_t; ++ using std::atomic_uintmax_t; ++ using std::atomic_uintptr_t; ++ ++ using std::atomic_signed_lock_free; ++ using std::atomic_unsigned_lock_free; ++ ++ // [atomics.flag], flag type and operations ++ using std::atomic_flag; ++ ++ using std::atomic_flag_clear; ++ using std::atomic_flag_clear_explicit; ++ using std::atomic_flag_test; ++ using std::atomic_flag_test_and_set; ++ using std::atomic_flag_test_and_set_explicit; ++ using std::atomic_flag_test_explicit; ++ ++ using std::atomic_flag_notify_all; ++ using std::atomic_flag_notify_one; ++ using std::atomic_flag_wait; ++ using std::atomic_flag_wait_explicit; ++ ++ // [atomics.fences], fences ++ // extern "C" { TODO investigate how to export ++ using std::atomic_signal_fence; ++ using std::atomic_thread_fence; ++ // } ++ ++ // [depr.atomics.nonmembers] ++ using std::atomic_init; ++ ++} // namespace std +diff --git a/libcxx/modules/std/barrier.cppm b/libcxx/modules/std/barrier.cppm +new file mode 100644 +index 000000000000..bdecfaedad82 +--- /dev/null ++++ b/libcxx/modules/std/barrier.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:barrier; ++export namespace std { ++ using std::barrier; ++} // namespace std +diff --git a/libcxx/modules/std/bit.cppm b/libcxx/modules/std/bit.cppm +new file mode 100644 +index 000000000000..7011f0b05c8b +--- /dev/null ++++ b/libcxx/modules/std/bit.cppm +@@ -0,0 +1,40 @@ ++// -*- 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:bit; ++export namespace std { ++ // [bit.cast], bit_cast ++ using std::bit_cast; ++ ++ // [bit.byteswap], byteswap ++ using std::byteswap; ++ ++ // [bit.pow.two], using std:: of 2 ++ using std::bit_ceil; ++ using std::bit_floor; ++ using std::bit_width; ++ using std::has_single_bit; ++ ++ // [bit.rotate], rotating ++ using std::rotl; ++ using std::rotr; ++ ++ // [bit.count], counting ++ using std::countl_one; ++ using std::countl_zero; ++ using std::countr_one; ++ using std::countr_zero; ++ using std::popcount; ++ ++ // [bit.endian], endian ++ using std::endian; ++} // namespace std +diff --git a/libcxx/modules/std/bitset.cppm b/libcxx/modules/std/bitset.cppm +new file mode 100644 +index 000000000000..95404c899ef0 +--- /dev/null ++++ b/libcxx/modules/std/bitset.cppm +@@ -0,0 +1,27 @@ ++// -*- 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:bitset; ++export namespace std { ++ using std::bitset; ++ ++ // [bitset.operators], bitset operators ++ using std::operator&; ++ using std::operator|; ++ using std::operator^; ++ using std::operator>>; ++ using std::operator<<; ++ ++ // [bitset.hash], hash support ++ using std::hash; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cassert.cppm b/libcxx/modules/std/cassert.cppm +new file mode 100644 +index 000000000000..21dcd1829b42 +--- /dev/null ++++ b/libcxx/modules/std/cassert.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:cassert; ++export namespace std { ++ // This module exports nothing. ++} // namespace std +diff --git a/libcxx/modules/std/cctype.cppm b/libcxx/modules/std/cctype.cppm +new file mode 100644 +index 000000000000..d91c5c505d39 +--- /dev/null ++++ b/libcxx/modules/std/cctype.cppm +@@ -0,0 +1,29 @@ ++// -*- 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:cctype; ++export namespace std { ++ using std::isalnum; ++ using std::isalpha; ++ using std::isblank; ++ using std::iscntrl; ++ using std::isdigit; ++ using std::isgraph; ++ using std::islower; ++ using std::isprint; ++ using std::ispunct; ++ using std::isspace; ++ using std::isupper; ++ using std::isxdigit; ++ using std::tolower; ++ using std::toupper; ++} // namespace std +diff --git a/libcxx/modules/std/cerrno.cppm b/libcxx/modules/std/cerrno.cppm +new file mode 100644 +index 000000000000..d319956d9e70 +--- /dev/null ++++ b/libcxx/modules/std/cerrno.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:cerrno; ++export namespace std { ++ // This module exports nothing. ++} // namespace std +diff --git a/libcxx/modules/std/cfenv.cppm b/libcxx/modules/std/cfenv.cppm +new file mode 100644 +index 000000000000..bb1d314980e5 +--- /dev/null ++++ b/libcxx/modules/std/cfenv.cppm +@@ -0,0 +1,34 @@ ++// -*- 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:cfenv; ++export namespace std { ++ // types ++ using std::fenv_t; ++ using std::fexcept_t; ++ ++ // functions ++ using std::feclearexcept; ++ using std::fegetexceptflag; ++ using std::feraiseexcept; ++ using std::fesetexceptflag; ++ using std::fetestexcept; ++ ++ using std::fegetround; ++ using std::fesetround; ++ ++ using std::fegetenv; ++ using std::feholdexcept; ++ using std::fesetenv; ++ using std::feupdateenv; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cfloat.cppm b/libcxx/modules/std/cfloat.cppm +new file mode 100644 +index 000000000000..daf4f55cfa11 +--- /dev/null ++++ b/libcxx/modules/std/cfloat.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:cfloat; ++export namespace std { ++ // This module exports nothing. ++} // namespace std +diff --git a/libcxx/modules/std/charconv.cppm b/libcxx/modules/std/charconv.cppm +new file mode 100644 +index 000000000000..0faa546a8d79 +--- /dev/null ++++ b/libcxx/modules/std/charconv.cppm +@@ -0,0 +1,38 @@ ++// -*- 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:charconv; ++export namespace std { ++ ++ // floating-point format for primitive numerical conversion ++ using std::chars_format; ++ ++ // chars_format is a bitmask type. ++ // [bitmask.types] specified operators ++ using std::operator&; ++ using std::operator&=; ++ using std::operator^; ++ using std::operator^=; ++ using std::operator|; ++ using std::operator|=; ++ using std::operator~; ++ ++ // [charconv.to.chars], primitive numerical output conversion ++ using std::to_chars_result; ++ ++ using std::to_chars; ++ ++ // [charconv.from.chars], primitive numerical input conversion ++ using std::from_chars_result; ++ ++ using std::from_chars; ++} // namespace std +diff --git a/libcxx/modules/std/chrono.cppm b/libcxx/modules/std/chrono.cppm +new file mode 100644 +index 000000000000..e222db190476 +--- /dev/null ++++ b/libcxx/modules/std/chrono.cppm +@@ -0,0 +1,286 @@ ++// -*- 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:chrono; ++export namespace std { ++ ++ namespace chrono { ++ using std::chrono::duration; ++ using std::chrono::time_point; ++ ++ } // namespace chrono ++ ++ using std::common_type; ++ ++ namespace chrono { ++ ++ // [time.traits], customization traits ++ using std::chrono::treat_as_floating_point; ++ using std::chrono::treat_as_floating_point_v; ++ ++ using std::chrono::duration_values; ++ ++ // using std::chrono::is_clock; NOT IMPLEMENTEDYET ++ // using std::chrono::is_clock_v; NOT IMPLEMENTEDYET ++ ++ // [time.duration.nonmember], duration arithmetic ++ using std::chrono::operator+; ++ using std::chrono::operator-; ++ using std::chrono::operator*; ++ using std::chrono::operator/; ++ using std::chrono::operator%; ++ ++ // [time.duration.comparisons], duration comparisons ++ using std::chrono::operator==; ++ using std::chrono::operator!=; ++ using std::chrono::operator<; ++ using std::chrono::operator>; ++ using std::chrono::operator<=; ++ using std::chrono::operator>=; ++ using std::chrono::operator<=>; ++ ++ // [time.duration.cast], conversions ++ using std::chrono::ceil; ++ using std::chrono::duration_cast; ++ using std::chrono::floor; ++ using std::chrono::round; ++ ++ // [time.duration.io], duration I/O ++#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) && !defined(_LIBCPP_HAS_NO_LOCALIZATION) ++ using std::chrono::operator<<; ++#endif ++ // using std::chrono::from_stream; NOT IMPLEMENTEDYET ++ ++ // convenience typedefs ++ using std::chrono::days; ++ using std::chrono::hours; ++ using std::chrono::microseconds; ++ using std::chrono::milliseconds; ++ using std::chrono::minutes; ++ using std::chrono::months; ++ using std::chrono::nanoseconds; ++ using std::chrono::seconds; ++ using std::chrono::weeks; ++ using std::chrono::years; ++ ++ // [time.point.nonmember], time_point arithmetic ++ ++ // [time.point.comparisons], time_point comparisons ++ ++ // [time.point.cast], conversions ++ using std::chrono::time_point_cast; ++ ++ // [time.duration.alg], specialized algorithms ++ using std::chrono::abs; ++ ++ // [time.clock.system], class system_clock ++ using std::chrono::system_clock; ++ ++ using std::chrono::sys_days; ++ using std::chrono::sys_seconds; ++ using std::chrono::sys_time; ++ ++#if 0 ++ // [time.clock.utc], class utc_clock ++ using std::chrono::utc_clock; ++ ++ using std::chrono::utc_seconds; ++ using std::chrono::utc_time; ++ ++ using std::chrono::leap_second_info; ++ ++ using std::chrono::get_leap_second_info; ++ // [time.clock.tai], class tai_clock ++ using std::chrono::tai_clock; ++ ++ using std::chrono::tai_seconds; ++ using std::chrono::tai_time; ++ ++ // [time.clock.gps], class gps_clock ++ using std::chrono::gps_clock; ++ ++ using std::chrono::gps_seconds; ++ using std::chrono::gps_time; ++#endif ++ // [time.clock.file], type file_clock ++ using std::chrono::file_clock; ++ ++ using std::chrono::file_time; ++ ++ // [time.clock.steady], class steady_clock ++ using std::chrono::steady_clock; ++ ++ // [time.clock.hires], class high_resolution_clock ++ using std::chrono::high_resolution_clock; ++ ++ // [time.clock.local], local time ++ using std::chrono::local_days; ++ using std::chrono::local_seconds; ++ using std::chrono::local_t; ++ using std::chrono::local_time; ++ ++ // [time.clock.cast], time_point conversions ++ // using std::chrono::clock_time_conversion; NOT IMPLEMENTED YET ++ ++ // using std::chrono::clock_cast; NOT IMPLEMENTED YET ++ ++ // [time.cal.last], class last_spec ++ using std::chrono::last_spec; ++ ++ // [time.cal.day], class day ++ using std::chrono::day; ++ ++ // [time.cal.month], class month ++ using std::chrono::month; ++ ++ // [time.cal.year], class year ++ using std::chrono::year; ++ ++ // [time.cal.wd], class weekday ++ using std::chrono::weekday; ++ ++ // [time.cal.wdidx], class weekday_indexed ++ using std::chrono::weekday_indexed; ++ ++ // [time.cal.wdlast], class weekday_last ++ using std::chrono::weekday_last; ++ ++ // [time.cal.md], class month_day ++ using std::chrono::month_day; ++ ++ // [time.cal.mdlast], class month_day_last ++ using std::chrono::month_day_last; ++ ++ // [time.cal.mwd], class month_weekday ++ using std::chrono::month_weekday; ++ ++ // [time.cal.mwdlast], class month_weekday_last ++ using std::chrono::month_weekday_last; ++ ++ // [time.cal.ym], class year_month ++ using std::chrono::year_month; ++ ++ // [time.cal.ymd], class year_month_day ++ using std::chrono::year_month_day; ++ ++ // [time.cal.ymdlast], class year_month_day_last ++ using std::chrono::year_month_day_last; ++ ++ // [time.cal.ymwd], class year_month_weekday ++ using std::chrono::year_month_weekday; ++ ++ // [time.cal.ymwdlast], class year_month_weekday_last ++ using std::chrono::year_month_weekday_last; ++ ++ // [time.cal.operators], civil calendar conventional syntax operators ++ ++ // [time.hms], class template hh_mm_ss ++ using std::chrono::hh_mm_ss; ++ ++ // [time.12], 12/24 hour functions ++ using std::chrono::is_am; ++ using std::chrono::is_pm; ++ using std::chrono::make12; ++ using std::chrono::make24; ++ ++#if 0 ++ // [time.zone.db], time zone database ++ using std::chrono::tzdb; ++ using std::chrono::tzdb_list; ++ ++ // [time.zone.db.access], time zone database access ++ using std::chrono::current_zone; ++ using std::chrono::get_tzdb; ++ using std::chrono::get_tzdb_list; ++ using std::chrono::locate_zone; ++ ++ // [time.zone.db.remote], remote time zone database support ++ using std::chrono::reload_tzdb; ++ using std::chrono::remote_version; ++ ++ // [time.zone.exception], exception classes ++ using std::chrono::ambiguous_local_time; ++ using std::chrono::nonexistent_local_time; ++ ++ // [time.zone.info], information classes ++ using std::chrono::sys_info; ++ ++ // [time.zone.timezone], class time_zone ++ using std::chrono::choose; ++ using std::chrono::time_zone; ++ ++ // [time.zone.zonedtraits], class template zoned_traits ++ using std::chrono::zoned_traits; ++ ++ // [time.zone.zonedtime], class template zoned_time ++ using std::chrono::zoned_time; ++ ++ using std::chrono::zoned_seconds; ++ ++ // [time.zone.leap], leap second support ++ using std::chrono::leap_second; ++ ++ // [time.zone.link], class time_zone_link ++ using std::chrono::time_zone_link; ++ ++ // [time.format], formatting ++ using std::chrono::local_time_format; ++#endif ++ } // namespace chrono ++ ++ using std::formatter; ++ ++ namespace chrono { ++ // using std::chrono::parse;NOT IMPLEMENTED YET ++ ++ // calendrical constants ++ using std::chrono::last; ++ ++ using std::chrono::Friday; ++ using std::chrono::Monday; ++ using std::chrono::Saturday; ++ using std::chrono::Sunday; ++ using std::chrono::Thursday; ++ using std::chrono::Tuesday; ++ using std::chrono::Wednesday; ++ ++ using std::chrono::April; ++ using std::chrono::August; ++ using std::chrono::December; ++ using std::chrono::February; ++ using std::chrono::January; ++ using std::chrono::July; ++ using std::chrono::June; ++ using std::chrono::March; ++ using std::chrono::May; ++ using std::chrono::November; ++ using std::chrono::October; ++ using std::chrono::September; ++ ++ } // namespace chrono ++ ++} // namespace std ++export namespace std::inline literals::inline chrono_literals { ++ // [time.duration.literals], suffixes for duration literals ++ using std::literals::chrono_literals::operator""h; ++ using std::literals::chrono_literals::operator""min; ++ using std::literals::chrono_literals::operator""s; ++ using std::literals::chrono_literals::operator""ms; ++ using std::literals::chrono_literals::operator""us; ++ using std::literals::chrono_literals::operator""ns; ++ ++ // [using std::literals::chrono_literals::.cal.day.nonmembers], non-member functions ++ using std::literals::chrono_literals::operator""d; ++ ++ // [using std::literals::chrono_literals::.cal.year.nonmembers], non-member functions ++ using std::literals::chrono_literals::operator""y; ++} // namespace std::inline literals::inline chrono_literals +diff --git a/libcxx/modules/std/cinttypes.cppm b/libcxx/modules/std/cinttypes.cppm +new file mode 100644 +index 000000000000..8758acc6ff91 +--- /dev/null ++++ b/libcxx/modules/std/cinttypes.cppm +@@ -0,0 +1,29 @@ ++// -*- 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:cinttypes; ++export namespace std { ++ using std::imaxdiv_t; ++ ++ using std::imaxabs; ++ using std::imaxdiv; ++ using std::strtoimax; ++ using std::strtoumax; ++ using std::wcstoimax; ++ using std::wcstoumax; ++ ++ // abs is conditionally here, but always present in cmath.cppm. To avoid ++ // conflicing declarations omit the using here. ++ ++ // div is conditionally here, but always present in cstdlib.cppm. To avoid ++ // conflicing declarations omit the using here. ++} // namespace std +diff --git a/libcxx/modules/std/climits.cppm b/libcxx/modules/std/climits.cppm +new file mode 100644 +index 000000000000..04603b796534 +--- /dev/null ++++ b/libcxx/modules/std/climits.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:climits; ++export namespace std { ++ // This module exports nothing. ++} // namespace std +diff --git a/libcxx/modules/std/clocale.cppm b/libcxx/modules/std/clocale.cppm +new file mode 100644 +index 000000000000..57d983c703ed +--- /dev/null ++++ b/libcxx/modules/std/clocale.cppm +@@ -0,0 +1,25 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:clocale; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ using std::lconv; ++ ++ using std::localeconv; ++ using std::setlocale; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/cmath.cppm b/libcxx/modules/std/cmath.cppm +new file mode 100644 +index 000000000000..d3a26046fb44 +--- /dev/null ++++ b/libcxx/modules/std/cmath.cppm +@@ -0,0 +1,379 @@ ++// -*- 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:cmath; ++export namespace std { ++ ++ using std::double_t; ++ using std::float_t; ++ ++ using std::acos; ++ using std::acosf; ++ using std::acosl; ++ ++ using std::asin; ++ using std::asinf; ++ using std::asinl; ++ ++ using std::atan; ++ using std::atanf; ++ using std::atanl; ++ ++ using std::atan2; ++ using std::atan2f; ++ using std::atan2l; ++ ++ using std::cos; ++ using std::cosf; ++ using std::cosl; ++ ++ using std::sin; ++ using std::sinf; ++ using std::sinl; ++ ++ using std::tan; ++ using std::tanf; ++ using std::tanl; ++ ++ using std::acosh; ++ using std::acoshf; ++ using std::acoshl; ++ ++ using std::asinh; ++ using std::asinhf; ++ using std::asinhl; ++ ++ using std::atanh; ++ using std::atanhf; ++ using std::atanhl; ++ ++ using std::cosh; ++ using std::coshf; ++ using std::coshl; ++ ++ using std::sinh; ++ using std::sinhf; ++ using std::sinhl; ++ ++ using std::tanh; ++ using std::tanhf; ++ using std::tanhl; ++ ++ using std::exp; ++ using std::expf; ++ using std::expl; ++ ++ using std::exp2; ++ using std::exp2f; ++ using std::exp2l; ++ ++ using std::expm1; ++ using std::expm1f; ++ using std::expm1l; ++ ++ using std::frexp; ++ using std::frexpf; ++ using std::frexpl; ++ ++ using std::ilogb; ++ using std::ilogbf; ++ using std::ilogbl; ++ ++ using std::ldexp; ++ using std::ldexpf; ++ using std::ldexpl; ++ ++ using std::log; ++ using std::logf; ++ using std::logl; ++ ++ using std::log10; ++ using std::log10f; ++ using std::log10l; ++ ++ using std::log1p; ++ using std::log1pf; ++ using std::log1pl; ++ ++ using std::log2; ++ using std::log2f; ++ using std::log2l; ++ ++ using std::logb; ++ using std::logbf; ++ using std::logbl; ++ ++ using std::modf; ++ using std::modff; ++ using std::modfl; ++ ++ using std::scalbn; ++ using std::scalbnf; ++ using std::scalbnl; ++ ++ using std::scalbln; ++ using std::scalblnf; ++ using std::scalblnl; ++ ++ using std::cbrt; ++ using std::cbrtf; ++ using std::cbrtl; ++ ++ // [c.math.abs], absolute values ++ using std::abs; ++ ++ using std::fabs; ++ using std::fabsf; ++ using std::fabsl; ++ ++ using std::hypot; ++ using std::hypotf; ++ using std::hypotl; ++ ++ // [c.math.hypot3], three-dimensional hypotenuse ++ using std::hypot; ++ ++ using std::pow; ++ using std::powf; ++ using std::powl; ++ ++ using std::sqrt; ++ using std::sqrtf; ++ using std::sqrtl; ++ ++ using std::erf; ++ using std::erff; ++ using std::erfl; ++ ++ using std::erfc; ++ using std::erfcf; ++ using std::erfcl; ++ ++ using std::lgamma; ++ using std::lgammaf; ++ using std::lgammal; ++ ++ using std::tgamma; ++ using std::tgammaf; ++ using std::tgammal; ++ ++ using std::ceil; ++ using std::ceilf; ++ using std::ceill; ++ ++ using std::floor; ++ using std::floorf; ++ using std::floorl; ++ ++ using std::nearbyint; ++ using std::nearbyintf; ++ using std::nearbyintl; ++ ++ using std::rint; ++ using std::rintf; ++ using std::rintl; ++ ++ using std::lrint; ++ using std::lrintf; ++ using std::lrintl; ++ ++ using std::llrint; ++ using std::llrintf; ++ using std::llrintl; ++ ++ using std::round; ++ using std::roundf; ++ using std::roundl; ++ ++ using std::lround; ++ using std::lroundf; ++ using std::lroundl; ++ ++ using std::llround; ++ using std::llroundf; ++ using std::llroundl; ++ ++ using std::trunc; ++ using std::truncf; ++ using std::truncl; ++ ++ using std::fmod; ++ using std::fmodf; ++ using std::fmodl; ++ ++ using std::remainder; ++ using std::remainderf; ++ using std::remainderl; ++ ++ using std::remquo; ++ using std::remquof; ++ using std::remquol; ++ ++ using std::copysign; ++ using std::copysignf; ++ using std::copysignl; ++ ++ using std::nan; ++ using std::nanf; ++ using std::nanl; ++ ++ using std::nextafter; ++ using std::nextafterf; ++ using std::nextafterl; ++ ++ using std::nexttoward; ++ using std::nexttowardf; ++ using std::nexttowardl; ++ ++ using std::fdim; ++ using std::fdimf; ++ using std::fdiml; ++ ++ using std::fmax; ++ using std::fmaxf; ++ using std::fmaxl; ++ ++ using std::fmin; ++ using std::fminf; ++ using std::fminl; ++ ++ using std::fma; ++ using std::fmaf; ++ using std::fmal; ++ ++ // [c.math.lerp], linear interpolation ++ using std::lerp; ++ ++ // [c.math.fpclass], classification / comparison functions ++ using std::fpclassify; ++ using std::isfinite; ++ using std::isgreater; ++ using std::isgreaterequal; ++ using std::isinf; ++ using std::isless; ++ using std::islessequal; ++ using std::islessgreater; ++ using std::isnan; ++ using std::isnormal; ++ using std::isunordered; ++ using std::signbit; ++ ++ // [sf.cmath], mathematical special functions ++#if 0 ++ // [sf.cmath.assoc.laguerre], associated Laguerre polynomials ++ using std::assoc_laguerre; ++ using std::assoc_laguerref; ++ using std::assoc_laguerrel; ++ ++ // [sf.cmath.assoc.legendre], associated Legendre functions ++ using std::assoc_legendre; ++ using std::assoc_legendref; ++ using std::assoc_legendrel; ++ ++ // [sf.cmath.beta], beta function ++ using std::beta; ++ using std::betaf; ++ using std::betal; ++ ++ // [sf.cmath.comp.ellint.1], complete elliptic integral of the first kind ++ using std::comp_ellint_1; ++ using std::comp_ellint_1f; ++ using std::comp_ellint_1l; ++ ++ // [sf.cmath.comp.ellint.2], complete elliptic integral of the second kind ++ using std::comp_ellint_2; ++ using std::comp_ellint_2f; ++ using std::comp_ellint_2l; ++ ++ // [sf.cmath.comp.ellint.3], complete elliptic integral of the third kind ++ using std::comp_ellint_3; ++ using std::comp_ellint_3f; ++ using std::comp_ellint_3l; ++ ++ // [sf.cmath.cyl.bessel.i], regular modified cylindrical Bessel functions ++ using std::cyl_bessel_i; ++ using std::cyl_bessel_if; ++ using std::cyl_bessel_il; ++ ++ // [sf.cmath.cyl.bessel.j], cylindrical Bessel functions of the first kind ++ using std::cyl_bessel_j; ++ using std::cyl_bessel_jf; ++ using std::cyl_bessel_jl; ++ ++ // [sf.cmath.cyl.bessel.k], irregular modified cylindrical Bessel functions ++ using std::cyl_bessel_k; ++ using std::cyl_bessel_kf; ++ using std::cyl_bessel_kl; ++ ++ // [sf.cmath.cyl.neumann], cylindrical Neumann functions ++ // cylindrical Bessel functions of the second kind ++ using std::cyl_neumann; ++ using std::cyl_neumannf; ++ using std::cyl_neumannl; ++ ++ // [sf.cmath.ellint.1], incomplete elliptic integral of the first kind ++ using std::ellint_1; ++ using std::ellint_1f; ++ using std::ellint_1l; ++ ++ // [sf.cmath.ellint.2], incomplete elliptic integral of the second kind ++ using std::ellint_2; ++ using std::ellint_2f; ++ using std::ellint_2l; ++ ++ // [sf.cmath.ellint.3], incomplete elliptic integral of the third kind ++ using std::ellint_3; ++ using std::ellint_3f; ++ using std::ellint_3l; ++ ++ // [sf.cmath.expint], exponential integral ++ using std::expint; ++ using std::expintf; ++ using std::expintl; ++ ++ // [sf.cmath.hermite], Hermite polynomials ++ using std::hermite; ++ using std::hermitef; ++ using std::hermitel; ++ ++ // [sf.cmath.laguerre], Laguerre polynomials ++ using std::laguerre; ++ using std::laguerref; ++ using std::laguerrel; ++ ++ // [sf.cmath.legendre], Legendre polynomials ++ using std::legendre; ++ using std::legendref; ++ using std::legendrel; ++ ++ // [sf.cmath.riemann.zeta], Riemann zeta function ++ using std::riemann_zeta; ++ using std::riemann_zetaf; ++ using std::riemann_zetal; ++ ++ // [sf.cmath.sph.bessel], spherical Bessel functions of the first kind ++ using std::sph_bessel; ++ using std::sph_besself; ++ using std::sph_bessell; ++ ++ // [sf.cmath.sph.legendre], spherical associated Legendre functions ++ using std::sph_legendre; ++ using std::sph_legendref; ++ using std::sph_legendrel; ++ ++ // [sf.cmath.sph.neumann], spherical Neumann functions; ++ // spherical Bessel functions of the second kind ++ using std::sph_neumann; ++ using std::sph_neumannf; ++ using std::sph_neumannl; ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/codecvt.cppm b/libcxx/modules/std/codecvt.cppm +new file mode 100644 +index 000000000000..caa24c4ca47f +--- /dev/null ++++ b/libcxx/modules/std/codecvt.cppm +@@ -0,0 +1,27 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:codecvt; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::codecvt_mode; ++ ++ using std::codecvt_utf16; ++ using std::codecvt_utf8; ++ using std::codecvt_utf8_utf16; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/compare.cppm b/libcxx/modules/std/compare.cppm +new file mode 100644 +index 000000000000..ebeff411855e +--- /dev/null ++++ b/libcxx/modules/std/compare.cppm +@@ -0,0 +1,55 @@ ++// -*- 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:compare; ++export namespace std { ++ ++ // [cmp.categories], comparison category types ++ using std::partial_ordering; ++ using std::strong_ordering; ++ using std::weak_ordering; ++ ++ // named comparison functions ++ using std::is_eq; ++ using std::is_gt; ++ using std::is_gteq; ++ using std::is_lt; ++ using std::is_lteq; ++ using std::is_neq; ++ ++ // [cmp.common], common comparison category type ++ using std::common_comparison_category; ++ using std::common_comparison_category_t; ++ ++ // [cmp.concept], concept three_way_comparable ++ using std::three_way_comparable; ++ using std::three_way_comparable_with; ++ ++ // [cmp.result], result of three-way comparison ++ using std::compare_three_way_result; ++ ++ using std::compare_three_way_result_t; ++ ++ // [comparisons.three.way], class compare_three_way ++ using std::compare_three_way; ++ ++ // [cmp.alg], comparison algorithms ++ inline namespace __cpo { ++ using std::__cpo::compare_partial_order_fallback; ++ using std::__cpo::compare_strong_order_fallback; ++ using std::__cpo::compare_weak_order_fallback; ++ using std::__cpo::partial_order; ++ using std::__cpo::strong_order; ++ using std::__cpo::weak_order; ++ } // namespace __cpo ++ ++} // namespace std +diff --git a/libcxx/modules/std/complex.cppm b/libcxx/modules/std/complex.cppm +new file mode 100644 +index 000000000000..fa2b44c68389 +--- /dev/null ++++ b/libcxx/modules/std/complex.cppm +@@ -0,0 +1,76 @@ ++// -*- 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:complex; ++export namespace std { ++ ++ // [complex], class template complex ++ using std::complex; ++ ++ // [complex.ops], operators ++ using std::operator+; ++ using std::operator-; ++ using std::operator*; ++ using std::operator/; ++ ++ using std::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ using std::operator>>; ++ using std::operator<<; ++ ++ // [complex.value.ops], values ++ using std::imag; ++ using std::real; ++ ++ using std::abs; ++ using std::arg; ++ using std::norm; ++ ++ using std::conj; ++ using std::polar; ++ using std::proj; ++ ++ // [complex.transcendentals], transcendentals ++ using std::acos; ++ using std::asin; ++ using std::atan; ++ ++ using std::acosh; ++ using std::asinh; ++ using std::atanh; ++ ++ using std::cos; ++ using std::cosh; ++ using std::exp; ++ using std::log; ++ using std::log10; ++ ++ using std::pow; ++ ++ using std::sin; ++ using std::sinh; ++ using std::sqrt; ++ using std::tan; ++ using std::tanh; ++ ++ // [complex.literals], complex literals ++ inline namespace literals { ++ inline namespace complex_literals { ++ using std::operator""il; ++ using std::operator""i; ++ using std::operator""if; ++ } // namespace complex_literals ++ } // namespace literals ++ ++} // namespace std +diff --git a/libcxx/modules/std/concepts.cppm b/libcxx/modules/std/concepts.cppm +new file mode 100644 +index 000000000000..6c3333eb27fe +--- /dev/null ++++ b/libcxx/modules/std/concepts.cppm +@@ -0,0 +1,100 @@ ++// -*- 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:concepts; ++export namespace std { ++ ++ // [concepts.lang], language-related concepts ++ // [concept.same], concept same_as ++ using std::same_as; ++ ++ // [concept.derived], concept derived_from ++ using std::derived_from; ++ ++ // [concept.convertible], concept convertible_to ++ using std::convertible_to; ++ ++ // [concept.commonref], concept common_reference_with ++ using std::common_reference_with; ++ ++ // [concept.common], concept common_with ++ using std::common_with; ++ ++ // [concepts.arithmetic], arithmetic concepts ++ using std::floating_point; ++ using std::integral; ++ using std::signed_integral; ++ using std::unsigned_integral; ++ ++ // [concept.assignable], concept assignable_from ++ using std::assignable_from; ++ ++ // [concept.swappable], concept swappable ++ namespace ranges { ++ inline namespace __cpo { ++ using std::ranges::__cpo::swap; ++ } ++ } // namespace ranges ++ ++ using std::swappable; ++ using std::swappable_with; ++ ++ // [concept.destructible], concept destructible ++ using std::destructible; ++ ++ // [concept.constructible], concept constructible_from ++ using std::constructible_from; ++ ++ // [concept.default.init], concept default_initializable ++ using std::default_initializable; ++ ++ // [concept.moveconstructible], concept move_constructible ++ using std::move_constructible; ++ ++ // [concept.copyconstructible], concept copy_constructible ++ using std::copy_constructible; ++ ++ // [concepts.compare], comparison concepts ++ // [concept.equalitycomparable], concept equality_comparable ++ using std::equality_comparable; ++ using std::equality_comparable_with; ++ ++ // [concept.totallyordered], concept totally_ordered ++ using std::totally_ordered; ++ using std::totally_ordered_with; ++ ++ // [concepts.object], object concepts ++ using std::copyable; ++ using std::movable; ++ using std::regular; ++ using std::semiregular; ++ ++ // [concepts.callable], callable concepts ++ // [concept.invocable], concept invocable ++ using std::invocable; ++ ++ // [concept.regularinvocable], concept regular_invocable ++ using std::regular_invocable; ++ ++ // [concept.predicate], concept predicate ++ using std::predicate; ++ ++ // [concept.relation], concept relation ++ using std::relation; ++ ++ // [concept.equiv], concept equivalence_relation ++ using std::equivalence_relation; ++ ++ // [concept.strictweakorder], concept strict_weak_order ++ using std::strict_weak_order; ++ ++} // namespace std +diff --git a/libcxx/modules/std/condition_variable.cppm b/libcxx/modules/std/condition_variable.cppm +new file mode 100644 +index 000000000000..4528c4150b8b +--- /dev/null ++++ b/libcxx/modules/std/condition_variable.cppm +@@ -0,0 +1,26 @@ ++// -*- 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:condition_variable; ++export namespace std { ++ ++ // [thread.condition.condvar], class condition_variable ++ using std::condition_variable; ++ // [thread.condition.condvarany], class condition_variable_any ++ using std::condition_variable_any; ++ ++ // [thread.condition.nonmember], non-member functions ++ using std::notify_all_at_thread_exit; ++ ++ using std::cv_status; ++ ++} // namespace std +diff --git a/libcxx/modules/std/coroutine.cppm b/libcxx/modules/std/coroutine.cppm +new file mode 100644 +index 000000000000..a99855c7bbd9 +--- /dev/null ++++ b/libcxx/modules/std/coroutine.cppm +@@ -0,0 +1,27 @@ ++// -*- 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 ++#include ++export module std:coroutine; ++export namespace std { ++ using std::coroutine_handle; ++ using std::coroutine_traits; ++ using std::operator==; ++ using std::operator<=>; ++ using std::noop_coroutine; ++ using std::noop_coroutine_handle; ++ using std::noop_coroutine_promise; ++ ++ using std::suspend_always; ++ using std::suspend_never; ++ ++ using std::hash; ++} // namespace std +diff --git a/libcxx/modules/std/csetjmp.cppm b/libcxx/modules/std/csetjmp.cppm +new file mode 100644 +index 000000000000..ba97c0c4aa53 +--- /dev/null ++++ b/libcxx/modules/std/csetjmp.cppm +@@ -0,0 +1,17 @@ ++// -*- 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:csetjmp; ++export namespace std { ++ using std::jmp_buf; ++ using std::longjmp; ++} // namespace std +diff --git a/libcxx/modules/std/csignal.cppm b/libcxx/modules/std/csignal.cppm +new file mode 100644 +index 000000000000..90a6c562bc8c +--- /dev/null ++++ b/libcxx/modules/std/csignal.cppm +@@ -0,0 +1,22 @@ ++// -*- 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:csignal; ++export namespace std { ++ using std::sig_atomic_t; ++ ++ // [support.signal], signal handlers ++ using std::signal; ++ ++ using std::raise; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cstdarg.cppm b/libcxx/modules/std/cstdarg.cppm +new file mode 100644 +index 000000000000..d5fe4ca32e33 +--- /dev/null ++++ b/libcxx/modules/std/cstdarg.cppm +@@ -0,0 +1,17 @@ ++// -*- 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:cstdarg; ++export namespace std { ++ using std::va_list; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cstddef.cppm b/libcxx/modules/std/cstddef.cppm +new file mode 100644 +index 000000000000..aecee6e33aeb +--- /dev/null ++++ b/libcxx/modules/std/cstddef.cppm +@@ -0,0 +1,35 @@ ++// -*- 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:cstddef; ++export namespace std { ++ using std::max_align_t; ++ using std::nullptr_t; ++ using std::ptrdiff_t; ++ using std::size_t; ++ ++ using std::byte; ++ ++ // [support.types.byteops], byte type operations ++ using std::operator<<=; ++ using std::operator<<; ++ using std::operator>>=; ++ using std::operator>>; ++ using std::operator|=; ++ using std::operator|; ++ using std::operator&=; ++ using std::operator&; ++ using std::operator^=; ++ using std::operator^; ++ using std::operator~; ++ using std::to_integer; ++} // namespace std +diff --git a/libcxx/modules/std/cstdint.cppm b/libcxx/modules/std/cstdint.cppm +new file mode 100644 +index 000000000000..a491e9d5fd28 +--- /dev/null ++++ b/libcxx/modules/std/cstdint.cppm +@@ -0,0 +1,57 @@ ++// -*- 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:cstdint; ++export namespace std { ++ // validate the list against the proper C standard ++ ++ // signed ++ using std::int8_t _LIBCPP_USING_IF_EXISTS; ++ using std::int16_t _LIBCPP_USING_IF_EXISTS; ++ using std::int32_t _LIBCPP_USING_IF_EXISTS; ++ using std::int64_t _LIBCPP_USING_IF_EXISTS; ++ ++ using std::int_fast16_t; ++ using std::int_fast32_t; ++ using std::int_fast64_t; ++ using std::int_fast8_t; ++ ++ using std::int_least16_t; ++ using std::int_least32_t; ++ using std::int_least64_t; ++ using std::int_least8_t; ++ ++ using std::intmax_t; ++ ++ using std::intptr_t _LIBCPP_USING_IF_EXISTS; ++ ++ // unsigned ++ using std::uint8_t _LIBCPP_USING_IF_EXISTS; ++ using std::uint16_t _LIBCPP_USING_IF_EXISTS; ++ using std::uint32_t _LIBCPP_USING_IF_EXISTS; ++ using std::uint64_t _LIBCPP_USING_IF_EXISTS; ++ ++ using std::uint_fast16_t; ++ using std::uint_fast32_t; ++ using std::uint_fast64_t; ++ using std::uint_fast8_t; ++ ++ using std::uint_least16_t; ++ using std::uint_least32_t; ++ using std::uint_least64_t; ++ using std::uint_least8_t; ++ ++ using std::uintmax_t; ++ ++ using std::uintptr_t _LIBCPP_USING_IF_EXISTS; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cstdio.cppm b/libcxx/modules/std/cstdio.cppm +new file mode 100644 +index 000000000000..1b8059f828bc +--- /dev/null ++++ b/libcxx/modules/std/cstdio.cppm +@@ -0,0 +1,65 @@ ++// -*- 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:cstdio; ++export namespace std { ++ using std::FILE; ++ using std::fpos_t; ++ using std::size_t; ++ ++ using std::clearerr; ++ using std::fclose; ++ using std::feof; ++ using std::ferror; ++ using std::fflush; ++ using std::fgetc; ++ using std::fgetpos; ++ using std::fgets; ++ using std::fopen; ++ using std::fprintf; ++ using std::fputc; ++ using std::fputs; ++ using std::fread; ++ using std::freopen; ++ using std::fscanf; ++ using std::fseek; ++ using std::fsetpos; ++ using std::ftell; ++ using std::fwrite; ++ using std::getc; ++ using std::getchar; ++ using std::perror; ++ using std::printf; ++ using std::putc; ++ using std::putchar; ++ using std::puts; ++ using std::remove; ++ using std::rename; ++ using std::rewind; ++ using std::scanf; ++ using std::setbuf; ++ using std::setvbuf; ++ using std::snprintf; ++ using std::sprintf; ++ using std::sscanf; ++ using std::tmpfile; ++ using std::tmpnam; ++ using std::ungetc; ++ using std::vfprintf; ++ using std::vfscanf; ++ using std::vprintf; ++ using std::vscanf; ++ using std::vsnprintf; ++ using std::vsprintf; ++ using std::vsscanf; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cstdlib.cppm b/libcxx/modules/std/cstdlib.cppm +new file mode 100644 +index 000000000000..365d7c1fea22 +--- /dev/null ++++ b/libcxx/modules/std/cstdlib.cppm +@@ -0,0 +1,77 @@ ++// -*- 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:cstdlib; ++export namespace std { ++ ++ using std::div_t; ++ using std::ldiv_t; ++ using std::lldiv_t; ++ using std::size_t; ++ ++ // [support.start.term], start and termination ++ using std::_Exit; ++ using std::abort; ++ using std::at_quick_exit; ++ using std::atexit; ++ using std::exit; ++ using std::quick_exit; ++ ++ using std::getenv; ++ using std::system; ++ ++ // [c.malloc], C library memory allocation ++ using std::aligned_alloc; ++ using std::calloc; ++ using std::free; ++ using std::malloc; ++ using std::realloc; ++ ++ using std::atof; ++ using std::atoi; ++ using std::atol; ++ using std::atoll; ++ using std::strtod; ++ using std::strtof; ++ using std::strtol; ++ using std::strtold; ++ using std::strtoll; ++ using std::strtoul; ++ using std::strtoull; ++ ++ // [c.mb.wcs], multibyte / wide string and character conversion functions ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::mblen; ++ using std::mbstowcs; ++ using std::mbtowc; ++ using std::wcstombs; ++ using std::wctomb; ++#endif ++ // [alg.c.library], C standard library algorithms ++ using std::bsearch; ++ using std::qsort; ++ ++ // [c.math.rand], low-quality random number generation ++ using std::rand; ++ using std::srand; ++ ++ // [c.math.abs], absolute values ++ using std::abs; ++ ++ using std::labs; ++ using std::llabs; ++ ++ using std::div; ++ using std::ldiv; ++ using std::lldiv; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cstring.cppm b/libcxx/modules/std/cstring.cppm +new file mode 100644 +index 000000000000..c83480a0c5b9 +--- /dev/null ++++ b/libcxx/modules/std/cstring.cppm +@@ -0,0 +1,41 @@ ++// -*- 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:cstring; ++export namespace std { ++ ++ using std::size_t; ++ ++ using std::memchr; ++ using std::memcmp; ++ using std::memcpy; ++ using std::memmove; ++ using std::memset; ++ using std::strcat; ++ using std::strchr; ++ using std::strcmp; ++ using std::strcoll; ++ using std::strcpy; ++ using std::strcspn; ++ using std::strerror; ++ using std::strlen; ++ using std::strncat; ++ using std::strncmp; ++ using std::strncpy; ++ using std::strpbrk; ++ using std::strrchr; ++ using std::strspn; ++ using std::strstr; ++ using std::strtok; ++ using std::strxfrm; ++ ++} // namespace std +diff --git a/libcxx/modules/std/ctime.cppm b/libcxx/modules/std/ctime.cppm +new file mode 100644 +index 000000000000..e3e0a87eccff +--- /dev/null ++++ b/libcxx/modules/std/ctime.cppm +@@ -0,0 +1,33 @@ ++// -*- 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:ctime; ++export namespace std { ++ using std::clock_t; ++ using std::size_t; ++ using std::time_t; ++ ++ using std::timespec; ++ using std::tm; ++ ++ using std::asctime; ++ using std::clock; ++ using std::ctime; ++ using std::difftime; ++ using std::gmtime; ++ using std::localtime; ++ using std::mktime; ++ using std::strftime; ++ using std::time; ++ using std::timespec_get; ++ ++} // namespace std +diff --git a/libcxx/modules/std/cuchar.cppm b/libcxx/modules/std/cuchar.cppm +new file mode 100644 +index 000000000000..6057222d95d3 +--- /dev/null ++++ b/libcxx/modules/std/cuchar.cppm +@@ -0,0 +1,33 @@ ++// -*- 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: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. ++ ++ // mbstate_t is conditionally here, but always present in cwchar.cppm. To avoid ++ // conflicing declarations omit the using here. ++ ++ // 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) ++ using std::mbrtoc8 _LIBCPP_USING_IF_EXISTS; ++ using std::c8rtomb _LIBCPP_USING_IF_EXISTS; ++#endif ++ using std::mbrtoc16 _LIBCPP_USING_IF_EXISTS; ++ using std::c16rtomb _LIBCPP_USING_IF_EXISTS; ++ using std::mbrtoc32 _LIBCPP_USING_IF_EXISTS; ++ using std::c32rtomb _LIBCPP_USING_IF_EXISTS; ++} // namespace std +diff --git a/libcxx/modules/std/cwchar.cppm b/libcxx/modules/std/cwchar.cppm +new file mode 100644 +index 000000000000..9be68a83e4bb +--- /dev/null ++++ b/libcxx/modules/std/cwchar.cppm +@@ -0,0 +1,88 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++# include ++#endif ++ ++export module std:cwchar; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++export namespace std { ++ using std::mbstate_t; ++ using std::size_t; ++ using std::wint_t; ++ ++ using std::tm; ++ ++ using std::btowc; ++ using std::fgetwc; ++ using std::fgetws; ++ using std::fputwc; ++ using std::fputws; ++ using std::fwide; ++ using std::fwprintf; ++ using std::fwscanf; ++ using std::getwc; ++ using std::getwchar; ++ using std::putwc; ++ using std::putwchar; ++ using std::swprintf; ++ using std::swscanf; ++ using std::ungetwc; ++ using std::vfwprintf; ++ using std::vfwscanf; ++ using std::vswprintf; ++ using std::vswscanf; ++ using std::vwprintf; ++ using std::vwscanf; ++ using std::wcscat; ++ using std::wcschr; ++ using std::wcscmp; ++ using std::wcscoll; ++ using std::wcscpy; ++ using std::wcscspn; ++ using std::wcsftime; ++ using std::wcslen; ++ using std::wcsncat; ++ using std::wcsncmp; ++ using std::wcsncpy; ++ using std::wcspbrk; ++ using std::wcsrchr; ++ using std::wcsspn; ++ using std::wcsstr; ++ using std::wcstod; ++ using std::wcstof; ++ using std::wcstok; ++ using std::wcstol; ++ using std::wcstold; ++ using std::wcstoll; ++ using std::wcstoul; ++ using std::wcstoull; ++ using std::wcsxfrm; ++ using std::wctob; ++ using std::wmemchr; ++ using std::wmemcmp; ++ using std::wmemcpy; ++ using std::wmemmove; ++ using std::wmemset; ++ using std::wprintf; ++ using std::wscanf; ++ ++ // [c.mb.wcs], multibyte / wide string and character conversion functions ++ using std::mbrlen; ++ using std::mbrtowc; ++ using std::mbsinit; ++ using std::mbsrtowcs; ++ using std::wcrtomb; ++ using std::wcsrtombs; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +diff --git a/libcxx/modules/std/cwctype.cppm b/libcxx/modules/std/cwctype.cppm +new file mode 100644 +index 000000000000..c61bcc321d7c +--- /dev/null ++++ b/libcxx/modules/std/cwctype.cppm +@@ -0,0 +1,44 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++# include ++#endif ++ ++export module std:cwctype; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++export namespace std { ++ ++ using std::wctrans_t; ++ using std::wctype_t; ++ using std::wint_t; ++ ++ using std::iswalnum; ++ using std::iswalpha; ++ using std::iswblank; ++ using std::iswcntrl; ++ using std::iswctype; ++ using std::iswdigit; ++ using std::iswgraph; ++ using std::iswlower; ++ using std::iswprint; ++ using std::iswpunct; ++ using std::iswspace; ++ using std::iswupper; ++ using std::iswxdigit; ++ using std::towctrans; ++ using std::towlower; ++ using std::towupper; ++ using std::wctrans; ++ using std::wctype; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +diff --git a/libcxx/modules/std/deque.cppm b/libcxx/modules/std/deque.cppm +new file mode 100644 +index 000000000000..e261cc7e9070 +--- /dev/null ++++ b/libcxx/modules/std/deque.cppm +@@ -0,0 +1,35 @@ ++// -*- 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:deque; ++export namespace std { ++ ++ // [deque], class template deque ++ using std::deque; ++ ++ using std::operator==; ++ using std::operator<=>; ++ ++ using std::swap; ++ ++ // [deque.erasure], erasure ++ using std::erase; ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::deque; ++ } ++ ++ // Note formatter not in synopsis ++ // TODO Test whether the ommission fails tests. ++ ++} // namespace std +diff --git a/libcxx/modules/std/exception.cppm b/libcxx/modules/std/exception.cppm +new file mode 100644 +index 000000000000..9e5a06764cc3 +--- /dev/null ++++ b/libcxx/modules/std/exception.cppm +@@ -0,0 +1,29 @@ ++// -*- 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:exception; ++export namespace std { ++ using std::bad_exception; ++ using std::current_exception; ++ using std::exception; ++ using std::exception_ptr; ++ using std::get_terminate; ++ using std::make_exception_ptr; ++ using std::nested_exception; ++ using std::rethrow_exception; ++ using std::rethrow_if_nested; ++ using std::set_terminate; ++ using std::terminate; ++ using std::terminate_handler; ++ using std::throw_with_nested; ++ using std::uncaught_exception; ++ using std::uncaught_exceptions; ++} // namespace std +diff --git a/libcxx/modules/std/execution.cppm b/libcxx/modules/std/execution.cppm +new file mode 100644 +index 000000000000..9c967f65d59c +--- /dev/null ++++ b/libcxx/modules/std/execution.cppm +@@ -0,0 +1,40 @@ ++// -*- 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:execution; ++#if 0 // TODO MODULES Enable when this feature is implemented ++export namespace std { ++ // [execpol.type], execution policy type trait ++ using std::is_execution_policy; ++ using std::is_execution_policy_v; ++} // namespace std ++ ++namespace std::execution { ++ // [execpol.seq], sequenced execution policy ++ using std::execution::sequenced_policy; ++ ++ // [execpol.par], parallel execution policy ++ using std::execution::parallel_policy; ++ ++ // [execpol.parunseq], parallel and unsequenced execution policy ++ using std::execution::parallel_unsequenced_policy; ++ ++ // [execpol.unseq], unsequenced execution policy ++ using std::execution::unsequenced_policy; ++ ++ // [execpol.objects], execution policy objects ++ using std::execution::par; ++ using std::execution::par_unseq; ++ using std::execution::seq; ++ using std::execution::unseq; ++} // namespace std::execution ++#endif +diff --git a/libcxx/modules/std/expected.cppm b/libcxx/modules/std/expected.cppm +new file mode 100644 +index 000000000000..b9805b02866e +--- /dev/null ++++ b/libcxx/modules/std/expected.cppm +@@ -0,0 +1,34 @@ ++// -*- 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 // Since C++23 ++ ++export module std:expected; ++export namespace std { ++ ++ // [expected.unexpected], class template unexpected ++ using std::unexpected; ++ ++ // [expected.bad], class template bad_expected_access ++ using std::bad_expected_access; ++ ++ // [expected.bad.void], specialization for void ++ ++ // in-place construction of unexpected values ++ using std::unexpect_t; ++ ++ using std::unexpect; ++ ++ // [expected.expected], class template expected ++ using std::expected; ++ ++ // [expected.void], partial specialization of expected for void types ++ ++} // namespace std +diff --git a/libcxx/modules/std/filesystem.cppm b/libcxx/modules/std/filesystem.cppm +new file mode 100644 +index 000000000000..8d7cd5391486 +--- /dev/null ++++ b/libcxx/modules/std/filesystem.cppm +@@ -0,0 +1,123 @@ ++// -*- 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:filesystem; ++export namespace std::filesystem { ++ ++ // [fs.class.path], paths ++ using std::filesystem::path; ++ ++ // [fs.path.nonmember], path non-member functions ++ using std::filesystem::hash_value; ++ using std::filesystem::swap; ++ ++ // [fs.class.filesystem.error], filesystem errors ++ using std::filesystem::filesystem_error; ++ ++ // [fs.class.directory.entry], directory entries ++ using std::filesystem::directory_entry; ++ ++ // [fs.class.directory.iterator], directory iterators ++ using std::filesystem::directory_iterator; ++ ++ // [fs.dir.itr.nonmembers], range access for directory iterators ++ using std::filesystem::begin; ++ using std::filesystem::end; ++ ++ // [fs.class.rec.dir.itr], recursive directory iterators ++ using std::filesystem::recursive_directory_iterator; ++ ++ // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators ++ using std::filesystem::begin; ++ using std::filesystem::end; ++ ++ // [fs.class.file.status], file status ++ using std::filesystem::file_status; ++ using std::filesystem::space_info; ++ ++ // [fs.enum], enumerations ++ using std::filesystem::copy_options; ++ using std::filesystem::directory_options; ++ using std::filesystem::file_type; ++ using std::filesystem::perm_options; ++ using std::filesystem::perms; ++ ++ using std::filesystem::file_time_type; ++ ++ // several of these enums are a bitmask type. ++ // [bitmask.types] specified operators ++ using std::filesystem::operator&; ++ using std::filesystem::operator&=; ++ using std::filesystem::operator^; ++ using std::filesystem::operator^=; ++ using std::filesystem::operator|; ++ using std::filesystem::operator|=; ++ using std::filesystem::operator~; ++ ++ // [fs.op.funcs], filesystem operations ++ using std::filesystem::absolute; ++ using std::filesystem::canonical; ++ using std::filesystem::copy; ++ using std::filesystem::copy_file; ++ using std::filesystem::copy_symlink; ++ using std::filesystem::create_directories; ++ using std::filesystem::create_directory; ++ using std::filesystem::create_directory_symlink; ++ using std::filesystem::create_hard_link; ++ using std::filesystem::create_symlink; ++ using std::filesystem::current_path; ++ using std::filesystem::equivalent; ++ using std::filesystem::exists; ++ using std::filesystem::file_size; ++ using std::filesystem::hard_link_count; ++ ++ using std::filesystem::is_block_file; ++ using std::filesystem::is_character_file; ++ using std::filesystem::is_directory; ++ using std::filesystem::is_empty; ++ using std::filesystem::is_fifo; ++ using std::filesystem::is_other; ++ using std::filesystem::is_regular_file; ++ using std::filesystem::is_socket; ++ using std::filesystem::is_symlink; ++ ++ using std::filesystem::last_write_time; ++ using std::filesystem::permissions; ++ using std::filesystem::proximate; ++ using std::filesystem::read_symlink; ++ using std::filesystem::relative; ++ using std::filesystem::remove; ++ ++ using std::filesystem::remove_all; ++ using std::filesystem::rename; ++ using std::filesystem::resize_file; ++ using std::filesystem::space; ++ using std::filesystem::status; ++ using std::filesystem::status_known; ++ using std::filesystem::symlink_status; ++ using std::filesystem::temp_directory_path; ++ using std::filesystem::weakly_canonical; ++ ++ // [depr.fs.path.factory] ++ using std::filesystem::u8path; ++ ++} // namespace std::filesystem ++ ++// [fs.path.hash], hash support ++namespace std { ++ using std::hash; ++} ++ ++namespace std::ranges { ++ using std::ranges::enable_borrowed_range; ++ using std::ranges::enable_view; ++} // namespace std::ranges +diff --git a/libcxx/modules/std/flat_map.cppm b/libcxx/modules/std/flat_map.cppm +new file mode 100644 +index 000000000000..ff26fe46ce7e +--- /dev/null ++++ b/libcxx/modules/std/flat_map.cppm +@@ -0,0 +1,38 @@ ++// -*- 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:flat_map; ++export namespace std { ++#if 0 ++ // [flat.map], class template flat_­map ++ using std::flat_map; ++ ++ using std::sorted_unique; ++ using std::sorted_unique_t; ++ ++ using std::uses_allocator; ++ ++ // [flat.map.erasure], erasure for flat_­map ++ using std::erase_if; ++ ++ // [flat.multimap], class template flat_­multimap ++ using std::flat_multimap; ++ ++ using std::sorted_equivalent; ++ using std::sorted_equivalent_t; ++ ++ // [flat.multimap.erasure], erasure for flat_­multimap ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/flat_set.cppm b/libcxx/modules/std/flat_set.cppm +new file mode 100644 +index 000000000000..39be6161a6bf +--- /dev/null ++++ b/libcxx/modules/std/flat_set.cppm +@@ -0,0 +1,40 @@ ++// -*- 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:flat_set; ++export namespace std { ++#if 0 ++ // [flat.set], class template flat_­set ++ using std::flat_set; ++ ++ using std::sorted_unique; ++ using std::sorted_unique_t; ++ ++ using std::Allocator > ; ++ ++ // [flat.set.erasure], erasure for flat_­set ++ using std::erase_if; ++ ++ // [flat.multiset], class template flat_­multiset ++ using std::flat_multiset; ++ ++ using std::sorted_equivalent; ++ using std::sorted_equivalent_t; ++ ++ using std::uses_allocator; ++ ++ // [flat.multiset.erasure], erasure for flat_­multiset ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/format.cppm b/libcxx/modules/std/format.cppm +new file mode 100644 +index 000000000000..7754baf658fd +--- /dev/null ++++ b/libcxx/modules/std/format.cppm +@@ -0,0 +1,82 @@ ++// -*- 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:format; ++#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) ++export namespace std { ++ ++ // [format.context], class template basic_format_context ++ using std::basic_format_context; ++ using std::format_context; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wformat_context; ++# endif ++ ++ // [format.args], class template basic_format_args ++ using std::basic_format_args; ++ using std::format_args; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wformat_args; ++# endif ++ ++ // [format.fmt.string], class template basic_format_string ++ using std::basic_format_string; ++ using std::format_string; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wformat_string; ++# endif ++ ++ // [format.functions], formatting functions ++ using std::format; ++ using std::format_to; ++ using std::vformat; ++ using std::vformat_to; ++ ++ using std::format_to_n; ++ using std::format_to_n_result; ++ using std::formatted_size; ++ ++ // [format.formatter], formatter ++ using std::formatter; ++ ++ // [format.formattable], concept formattable ++ using std::formattable; ++ ++ // [format.parse.ctx], class template basic_format_parse_context ++ using std::basic_format_parse_context; ++ using std::format_parse_context; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wformat_parse_context; ++# endif ++ ++ // [format.range], formatting of ranges ++ // [format.range.fmtkind], variable template format_kind ++ using std::format_kind; ++ using std::range_format; ++ ++ // [format.range.formatter], class template range_formatter ++ using std::range_formatter; ++ ++ // [format.arg], class template basic_format_arg ++ using std::basic_format_arg; ++ using std::visit_format_arg; ++ ++ // [format.arg.store], class template format-arg-store ++ using std::make_format_args; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::make_wformat_args; ++# endif ++ ++ // [format.error], class format_error ++ using std::format_error; ++} // namespace std ++#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT) +diff --git a/libcxx/modules/std/forward_list.cppm b/libcxx/modules/std/forward_list.cppm +new file mode 100644 +index 000000000000..69b47ba22509 +--- /dev/null ++++ b/libcxx/modules/std/forward_list.cppm +@@ -0,0 +1,32 @@ ++// -*- 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:forward_list; ++export namespace std { ++ ++ // [forward.list], class template forward_list ++ using std::forward_list; ++ ++ using std::operator==; ++ using std::operator<=>; ++ ++ using std::swap; ++ ++ // [forward.list.erasure], erasure ++ using std::erase; ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::forward_list; ++ } ++ ++} // namespace std +diff --git a/libcxx/modules/std/fstream.cppm b/libcxx/modules/std/fstream.cppm +new file mode 100644 +index 000000000000..8d4de2a75ff9 +--- /dev/null ++++ b/libcxx/modules/std/fstream.cppm +@@ -0,0 +1,50 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:fstream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::basic_filebuf; ++ ++ using std::swap; ++ ++ using std::filebuf; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wfilebuf; ++# endif ++ ++ using std::basic_ifstream; ++ ++ using std::ifstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wifstream; ++# endif ++ ++ using std::basic_ofstream; ++ ++ using std::ofstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wofstream; ++# endif ++ ++ using std::basic_fstream; ++ ++ using std::fstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wfstream; ++# endif ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/functional.cppm b/libcxx/modules/std/functional.cppm +new file mode 100644 +index 000000000000..46fa8d8e2bc1 +--- /dev/null ++++ b/libcxx/modules/std/functional.cppm +@@ -0,0 +1,124 @@ ++// -*- 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:functional; ++export namespace std { ++ // [func.invoke], invoke ++ using std::invoke; ++ using std::invoke_r; ++ ++ // [refwrap], reference_wrapper ++ using std::reference_wrapper; ++ ++ using std::cref; ++ using std::ref; ++ ++ // [arithmetic.operations], arithmetic operations ++ using std::divides; ++ using std::minus; ++ using std::modulus; ++ using std::multiplies; ++ using std::negate; ++ using std::plus; ++ // [comparisons], comparisons ++ using std::equal_to; ++ using std::greater; ++ using std::greater_equal; ++ using std::less; ++ using std::less_equal; ++ using std::not_equal_to; ++ ++ // [comparisons.three.way], class compare_three_way ++ using std::compare_three_way; ++ ++ // [logical.operations], logical operations ++ using std::logical_and; ++ using std::logical_not; ++ using std::logical_or; ++ ++ // [bitwise.operations], bitwise operations ++ using std::bit_and; ++ using std::bit_not; ++ using std::bit_or; ++ using std::bit_xor; ++ ++ // [func.identity], identity ++ using std::identity; ++ ++ // [func.not.fn], function template not_fn ++ using std::not_fn; ++ ++ // [func.bind.partial], function templates bind_front and bind_back ++ // using std::bind_back; not implemented ++ using std::bind_front; ++ ++ // [func.bind], bind ++ using std::is_bind_expression; ++ using std::is_bind_expression_v; ++ using std::is_placeholder; ++ using std::is_placeholder_v; ++ ++ using std::bind; ++ ++ namespace placeholders { ++ // M is the implementation-defined number of placeholders ++ using std::placeholders::_1; ++ using std::placeholders::_10; ++ using std::placeholders::_2; ++ using std::placeholders::_3; ++ using std::placeholders::_4; ++ using std::placeholders::_5; ++ using std::placeholders::_6; ++ using std::placeholders::_7; ++ using std::placeholders::_8; ++ using std::placeholders::_9; ++ } // namespace placeholders ++ ++ // [func.memfn], member function adaptors ++ using std::mem_fn; ++ ++ // [func.wrap], polymorphic function wrappers ++ using std::bad_function_call; ++ ++ using std::function; ++ ++ using std::swap; ++ ++ using std::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++ // [func.wrap.move], move only wrapper ++ // using std::move_only_function; not implemented ++ ++ // [func.search], searchers ++ using std::default_searcher; ++ ++ using std::boyer_moore_searcher; ++ ++ using std::boyer_moore_horspool_searcher; ++ ++ // [unord.hash], class template hash ++ using std::hash; ++ ++ namespace ranges { ++ // [range.cmp], concept-constrained comparisons ++ using std::ranges::equal_to; ++ using std::ranges::greater; ++ using std::ranges::greater_equal; ++ using std::ranges::less; ++ using std::ranges::less_equal; ++ using std::ranges::not_equal_to; ++ } // namespace ranges ++ ++} // namespace std +diff --git a/libcxx/modules/std/future.cppm b/libcxx/modules/std/future.cppm +new file mode 100644 +index 000000000000..a5d6a470e6f9 +--- /dev/null ++++ b/libcxx/modules/std/future.cppm +@@ -0,0 +1,61 @@ ++// -*- 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:future; ++export namespace std { ++ ++ using std::future_errc; ++ using std::future_status; ++ using std::launch; ++ ++ // launch is a bitmask type. ++ // [bitmask.types] specified operators ++ using std::operator&; ++ using std::operator&=; ++ using std::operator^; ++ using std::operator^=; ++ using std::operator|; ++ using std::operator|=; ++ using std::operator~; ++ ++ // [futures.errors], error handling ++ using std::is_error_code_enum; ++ using std::make_error_code; ++ using std::make_error_condition; ++ ++ using std::future_category; ++ ++ // [futures.future.error], class future_error ++ using std::future_error; ++ ++ // [futures.promise], class template promise ++ using std::promise; ++ ++ using std::swap; ++ ++ using std::uses_allocator; ++ ++ // [futures.unique.future], class template future ++ using std::future; ++ ++ // [futures.shared.future], class template shared_future ++ using std::shared_future; ++ ++ // [futures.task], class template packaged_task ++ using std::packaged_task; ++ ++ using std::swap; ++ ++ // [futures.async], function template async ++ using std::async; ++ ++} // namespace std +diff --git a/libcxx/modules/std/generator.cppm b/libcxx/modules/std/generator.cppm +new file mode 100644 +index 000000000000..c67f5d012679 +--- /dev/null ++++ b/libcxx/modules/std/generator.cppm +@@ -0,0 +1,21 @@ ++// -*- 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/initializer_list.cppm b/libcxx/modules/std/initializer_list.cppm +new file mode 100644 +index 000000000000..8e041f747cb5 +--- /dev/null ++++ b/libcxx/modules/std/initializer_list.cppm +@@ -0,0 +1,20 @@ ++// -*- 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:initializer_list; ++export namespace std { ++ using std::initializer_list; ++ ++ // [support.initlist.range], initializer list range access ++ using std::begin; ++ using std::end; ++} // namespace std +diff --git a/libcxx/modules/std/iomanip.cppm b/libcxx/modules/std/iomanip.cppm +new file mode 100644 +index 000000000000..6fa8534264e6 +--- /dev/null ++++ b/libcxx/modules/std/iomanip.cppm +@@ -0,0 +1,34 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:iomanip; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::get_money; ++ using std::get_time; ++ using std::put_money; ++ using std::put_time; ++ using std::resetiosflags; ++ using std::setbase; ++ using std::setfill; ++ using std::setiosflags; ++ using std::setprecision; ++ using std::setw; ++ ++ using std::quoted; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/ios.cppm b/libcxx/modules/std/ios.cppm +new file mode 100644 +index 000000000000..5dfb62575d0e +--- /dev/null ++++ b/libcxx/modules/std/ios.cppm +@@ -0,0 +1,85 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:ios; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::fpos; ++ // based on [tab:fpos.operations] ++ using std::operator!=; // Note not affected by P1614, seems like a bug. ++ using std::operator-; ++ using std::operator==; ++ ++ using std::streamoff; ++ using std::streamsize; ++ ++ using std::basic_ios; ++ using std::ios_base; ++ ++ // [std.ios.manip], manipulators ++ using std::boolalpha; ++ using std::noboolalpha; ++ ++ using std::noshowbase; ++ using std::showbase; ++ ++ using std::noshowpoint; ++ using std::showpoint; ++ ++ using std::noshowpos; ++ using std::showpos; ++ ++ using std::noskipws; ++ using std::skipws; ++ ++ using std::nouppercase; ++ using std::uppercase; ++ ++ using std::nounitbuf; ++ using std::unitbuf; ++ ++ // [adjustfield.manip], adjustfield ++ using std::internal; ++ using std::left; ++ using std::right; ++ ++ // [basefield.manip], basefield ++ using std::dec; ++ using std::hex; ++ using std::oct; ++ ++ // [floatfield.manip], floatfield ++ using std::defaultfloat; ++ using std::fixed; ++ using std::hexfloat; ++ using std::scientific; ++ ++ // [error.reporting], error reporting ++ using std::io_errc; ++ ++ using std::iostream_category; ++ using std::is_error_code_enum; ++ using std::make_error_code; ++ using std::make_error_condition; ++ ++ // [iosfwd.syn] ++ using std::ios; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wios; ++# endif ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/iosfwd.cppm b/libcxx/modules/std/iosfwd.cppm +new file mode 100644 +index 000000000000..d43b91888955 +--- /dev/null ++++ b/libcxx/modules/std/iosfwd.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:iosfwd; ++export namespace std { ++ // All symbols are exported by other modules. ++} // namespace std +diff --git a/libcxx/modules/std/iostream.cppm b/libcxx/modules/std/iostream.cppm +new file mode 100644 +index 000000000000..066480b91bc5 +--- /dev/null ++++ b/libcxx/modules/std/iostream.cppm +@@ -0,0 +1,33 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:iostream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::cerr; ++ using std::cin; ++ using std::clog; ++ using std::cout; ++ ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wcerr; ++ using std::wcin; ++ using std::wclog; ++ using std::wcout; ++# endif ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/istream.cppm b/libcxx/modules/std/istream.cppm +new file mode 100644 +index 000000000000..7c642ca5b459 +--- /dev/null ++++ b/libcxx/modules/std/istream.cppm +@@ -0,0 +1,39 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:istream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::basic_istream; ++ ++ using std::istream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wistream; ++# endif ++ ++ using std::basic_iostream; ++ ++ using std::iostream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wiostream; ++# endif ++ ++ using std::ws; ++ ++ using std::operator>>; ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/iterator.cppm b/libcxx/modules/std/iterator.cppm +new file mode 100644 +index 000000000000..0ec27ecac33d +--- /dev/null ++++ b/libcxx/modules/std/iterator.cppm +@@ -0,0 +1,254 @@ ++// -*- 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:iterator; ++export namespace std { ++ ++ // [iterator.assoc.types], associated types ++ // [incrementable.traits], incrementable traits ++ using std::incrementable_traits; ++ using std::iter_difference_t; ++ ++ using std::indirectly_readable_traits; ++ using std::iter_value_t; ++ ++ // [iterator.traits], iterator traits ++ using std::iterator_traits; ++ ++ using std::iter_reference_t; ++ ++ namespace ranges { ++ // [iterator.cust], customization point objects ++ inline namespace __cpo { ++ // [iterator.cust.move], ranges::iter_move ++ using std::ranges::__cpo::iter_move; ++ ++ // [iterator.cust.swap], ranges::iter_swap ++ using std::ranges::__cpo::iter_swap; ++ } // namespace __cpo ++ } // namespace ranges ++ ++ using std::iter_rvalue_reference_t; ++ ++ // [iterator.concepts], iterator concepts ++ // [iterator.concept.readable], concept indirectly_readable ++ using std::indirectly_readable; ++ ++ using std::iter_common_reference_t; ++ ++ // [iterator.concept.writable], concept indirectly_writable ++ using std::indirectly_writable; ++ ++ // [iterator.concept.winc], concept weakly_incrementable ++ using std::weakly_incrementable; ++ ++ // [iterator.concept.inc], concept incrementable ++ using std::incrementable; ++ ++ // [iterator.concept.iterator], concept input_or_output_iterator ++ using std::input_or_output_iterator; ++ ++ // [iterator.concept.sentinel], concept sentinel_for ++ using std::sentinel_for; ++ ++ // [iterator.concept.sizedsentinel], concept sized_sentinel_for ++ using std::disable_sized_sentinel_for; ++ ++ using std::sized_sentinel_for; ++ ++ // [iterator.concept.input], concept input_iterator ++ using std::input_iterator; ++ ++ // [iterator.concept.output], concept output_iterator ++ using std::output_iterator; ++ ++ // [iterator.concept.forward], concept forward_iterator ++ using std::forward_iterator; ++ ++ // [iterator.concept.bidir], concept bidirectional_iterator ++ using std::bidirectional_iterator; ++ ++ // [iterator.concept.random.access], concept random_access_iterator ++ using std::random_access_iterator; ++ ++ // [iterator.concept.contiguous], concept contiguous_iterator ++ using std::contiguous_iterator; ++ ++ // [indirectcallable], indirect callable requirements ++ // [indirectcallable.indirectinvocable], indirect callables ++ using std::indirectly_unary_invocable; ++ ++ using std::indirectly_regular_unary_invocable; ++ ++ using std::indirect_unary_predicate; ++ ++ using std::indirect_binary_predicate; ++ ++ using std::indirect_equivalence_relation; ++ ++ using std::indirect_strict_weak_order; ++ ++ using std::indirect_result_t; ++ ++ // [projected], projected ++ using std::projected; ++ ++ using std::incrementable_traits; ++ ++ // [alg.req], common algorithm requirements ++ // [alg.req.ind.move], concept indirectly_movable ++ using std::indirectly_movable; ++ ++ using std::indirectly_movable_storable; ++ ++ // [alg.req.ind.copy], concept indirectly_copyable ++ using std::indirectly_copyable; ++ ++ using std::indirectly_copyable_storable; ++ ++ // [alg.req.ind.swap], concept indirectly_swappable ++ using std::indirectly_swappable; ++ ++ // [alg.req.ind.cmp], concept indirectly_comparable ++ using std::indirectly_comparable; ++ ++ // [alg.req.permutable], concept permutable ++ using std::permutable; ++ ++ // [alg.req.mergeable], concept mergeable ++ using std::mergeable; ++ ++ // [alg.req.sortable], concept sortable ++ using std::sortable; ++ ++ // [iterator.primitives], primitives ++ // [std.iterator.tags], iterator tags ++ using std::bidirectional_iterator_tag; ++ using std::contiguous_iterator_tag; ++ using std::forward_iterator_tag; ++ using std::input_iterator_tag; ++ using std::output_iterator_tag; ++ using std::random_access_iterator_tag; ++ ++ // [iterator.operations], iterator operations ++ using std::advance; ++ using std::distance; ++ using std::next; ++ using std::prev; ++ ++ // [range.iter.ops], range iterator operations ++ namespace ranges { ++ // [range.iter.op.advance], ranges​::​advance ++ using std::ranges::advance; ++ ++ // [range.iter.op.distance], ranges​::​distance ++ using std::ranges::distance; ++ ++ // [range.iter.op.next], ranges​::​next ++ using std::ranges::next; ++ ++ // [range.iter.op.prev], ranges​::​prev ++ using std::ranges::prev; ++ } // namespace ranges ++ ++ // [predef.iterators], predefined iterators and sentinels ++ // [reverse.iterators], reverse iterators ++ using std::reverse_iterator; ++ ++ using std::operator==; ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++ using std::operator<=>; ++ ++ using std::operator-; ++ using std::operator+; ++ ++ using std::make_reverse_iterator; ++ ++ //using std::disable_sized_sentinel_for; ++ ++ // [insert.iterators], insert iterators ++ using std::back_insert_iterator; ++ using std::back_inserter; ++ ++ using std::front_insert_iterator; ++ using std::front_inserter; ++ ++ using std::insert_iterator; ++ using std::inserter; ++ ++ // [const.iterators], constant iterators and sentinels ++ // [const.iterators.alias], alias templates ++ // using std::const_iterator; NOT IMPLEMENTED ++ // using std::const_sentinel; NOT IMPLEMENTED ++ // using std::iter_const_reference_t; NOT IMPLEMENTED? ++ ++ // [const.iterators.iterator], class template basic_const_iterator ++ // using std::basic_const_iterator; NOT IMPLEMENTED ++ ++ // using std::common_type; NOT IMPLEMENTED ++ ++ // using std::make_const_iterator; NOT IMPLEMENTED ++ ++ // [move.iterators], move iterators and sentinels ++ using std::move_iterator; // freestanding ++ ++ using std::make_move_iterator; ++ ++ using std::move_sentinel; ++ ++ using std::common_iterator; ++ ++ using std::incrementable_traits; ++ ++ // [default.sentinel], default sentinel ++ using std::default_sentinel; ++ using std::default_sentinel_t; ++ ++ // [iterators.counted], counted iterators ++ using std::counted_iterator; ++ ++ // [unreachable.sentinel], unreachable sentinel ++ using std::unreachable_sentinel; ++ using std::unreachable_sentinel_t; ++ ++ // [stream.iterators], stream iterators ++ using std::istream_iterator; ++ ++ using std::ostream_iterator; ++ ++ using std::istreambuf_iterator; ++ using std::ostreambuf_iterator; ++ ++ // [iterator.range], range access ++ using std::begin; ++ using std::cbegin; ++ using std::cend; ++ using std::crbegin; ++ using std::crend; ++ using std::end; ++ using std::rbegin; ++ using std::rend; ++ ++ using std::empty; ++ using std::size; ++ using std::ssize; ++ ++ using std::data; ++ ++ // [depr.iterator] ++ using std::iterator; ++ ++} // namespace std +diff --git a/libcxx/modules/std/latch.cppm b/libcxx/modules/std/latch.cppm +new file mode 100644 +index 000000000000..71a060a8a533 +--- /dev/null ++++ b/libcxx/modules/std/latch.cppm +@@ -0,0 +1,17 @@ ++// -*- 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:latch; ++export namespace std { ++ using std::latch; ++ ++} // namespace std +diff --git a/libcxx/modules/std/limits.cppm b/libcxx/modules/std/limits.cppm +new file mode 100644 +index 000000000000..048eb49ccc5b +--- /dev/null ++++ b/libcxx/modules/std/limits.cppm +@@ -0,0 +1,23 @@ ++// -*- 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:limits; ++export namespace std { ++ ++ // [fp.style], floating-point type properties ++ using std::float_denorm_style; ++ using std::float_round_style; ++ ++ // [numeric.limits], class template numeric_­limits ++ using std::numeric_limits; ++ ++} // namespace std +diff --git a/libcxx/modules/std/list.cppm b/libcxx/modules/std/list.cppm +new file mode 100644 +index 000000000000..71b58502b362 +--- /dev/null ++++ b/libcxx/modules/std/list.cppm +@@ -0,0 +1,32 @@ ++// -*- 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:list; ++export namespace std { ++ ++ // [list], class template list ++ using std::list; ++ ++ using std::operator==; ++ using std::operator<=>; ++ ++ using std::swap; ++ ++ // [list.erasure], erasure ++ using std::erase; ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::list; ++ } ++ ++} // namespace std +diff --git a/libcxx/modules/std/locale.cppm b/libcxx/modules/std/locale.cppm +new file mode 100644 +index 000000000000..2988f5eaab6c +--- /dev/null ++++ b/libcxx/modules/std/locale.cppm +@@ -0,0 +1,85 @@ ++// -*- 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> ++#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; ++ using std::locale; ++ using std::use_facet; ++ ++ // [locale.convenience], convenience interfaces ++ using std::isalnum; ++ using std::isalpha; ++ using std::isblank; ++ using std::iscntrl; ++ using std::isdigit; ++ using std::isgraph; ++ using std::islower; ++ using std::isprint; ++ using std::ispunct; ++ using std::isspace; ++ using std::isupper; ++ using std::isxdigit; ++ using std::tolower; ++ using std::toupper; ++ ++ // [category.ctype], ctype ++ using std::codecvt; ++ using std::codecvt_base; ++ using std::codecvt_byname; ++ using std::ctype; ++ using std::ctype_base; ++ using std::ctype_byname; ++ ++ // [category.numeric], numeric ++ using std::num_get; ++ using std::num_put; ++ using std::numpunct; ++ using std::numpunct_byname; ++ ++ // [category.collate], collation ++ using std::collate; ++ using std::collate_byname; ++ ++ // [category.time], date and time ++ using std::time_base; ++ using std::time_get; ++ using std::time_get_byname; ++ using std::time_put; ++ using std::time_put_byname; ++ ++ // [category.monetary], money ++ using std::money_base; ++ using std::money_get; ++ using std::money_put; ++ using std::moneypunct; ++ using std::moneypunct_byname; ++ ++ // [category.messages], message retrieval ++ using std::messages; ++ using std::messages_base; ++ using std::messages_byname; ++ ++ // [depr.conversions.buffer] ++ using std::wbuffer_convert; ++ ++ // [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.cppm +new file mode 100644 +index 000000000000..3104c82a0975 +--- /dev/null ++++ b/libcxx/modules/std/map.cppm +@@ -0,0 +1,37 @@ ++// -*- 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:map; ++export namespace std { ++ // [map], class template map ++ using std::map; ++ ++ using std::operator==; ++ using std::operator<=>; ++ ++ using std::swap; ++ ++ // [map.erasure], erasure for map ++ using std::erase_if; ++ ++ // [multimap], class template multimap ++ using std::multimap; ++ ++ // [multimap.erasure], erasure for multimap ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::map; ++ using std::pmr::multimap; ++ } // namespace pmr ++ ++} // namespace std +diff --git a/libcxx/modules/std/mdspan.cppm b/libcxx/modules/std/mdspan.cppm +new file mode 100644 +index 000000000000..2993e9f2232c +--- /dev/null ++++ b/libcxx/modules/std/mdspan.cppm +@@ -0,0 +1,36 @@ ++// -*- 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:mdspan; ++export namespace std { ++#if 0 ++ // [mdspan.extents], class template extents ++ using std::extents; ++ ++ // [mdspan.extents.dextents], alias template dextents ++ using std::dextents; ++ ++ // [mdspan.layout], layout mapping ++ using std::layout_left; ++ using std::layout_right; ++ using std::layout_stride; ++ ++ // [mdspan.accessor.default], class template default_­accessor ++ using std::default_accessor; ++ ++ // [mdspan.mdspan], class template mdspan ++ using std::mdspan; ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/memory.cppm b/libcxx/modules/std/memory.cppm +new file mode 100644 +index 000000000000..e1fcf155b51e +--- /dev/null ++++ b/libcxx/modules/std/memory.cppm +@@ -0,0 +1,215 @@ ++// -*- 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:memory; ++export namespace std { ++ // [pointer.traits], pointer traits ++ using std::pointer_traits; ++ ++ // [pointer.conversion], pointer conversion ++ using std::to_address; ++ ++ // [ptr.align], pointer alignment ++ using std::align; ++ using std::assume_aligned; ++ ++ // [obj.lifetime], explicit lifetime management ++ // using std::start_lifetime_as; NOT IMPLEMENTED ++ // using std::start_lifetime_as_array NOT IMPLEMENTED; ++ ++ // [allocator.tag], allocator argument tag ++ using std::allocator_arg; ++ using std::allocator_arg_t; ++ ++ // [allocator.uses], uses_allocator ++ using std::uses_allocator; ++ ++ // [allocator.uses.trait], uses_allocator ++ using std::uses_allocator_v; ++ ++ // [allocator.uses.construction], uses-allocator construction ++ using std::uses_allocator_construction_args; ++ ++ using std::make_obj_using_allocator; ++ using std::uninitialized_construct_using_allocator; ++ ++ // [allocator.traits], allocator traits ++ using std::allocator_traits; // freestanding ++ ++ using std::allocation_result; ++ ++ using std::allocate_at_least; ++ ++ // [default.allocator], the default allocator ++ using std::allocator; ++ using std::operator==; ++ ++ // [specialized.addressof], addressof ++ using std::addressof; ++ ++ // [specialized.algorithms], specialized algorithms ++ // [special.mem.concepts], special memory concepts ++ ++ using std::uninitialized_default_construct; ++ using std::uninitialized_default_construct_n; ++ ++ namespace ranges { ++ using std::ranges::uninitialized_default_construct; ++ using std::ranges::uninitialized_default_construct_n; ++ } // namespace ranges ++ ++ using std::uninitialized_value_construct; ++ using std::uninitialized_value_construct_n; ++ ++ namespace ranges { ++ using std::ranges::uninitialized_value_construct; ++ using std::ranges::uninitialized_value_construct_n; ++ } // namespace ranges ++ ++ using std::uninitialized_copy; ++ using std::uninitialized_copy_n; ++ ++ namespace ranges { ++ using std::ranges::uninitialized_copy; ++ using std::ranges::uninitialized_copy_result; ++ ++ using std::ranges::uninitialized_copy_n; ++ using std::ranges::uninitialized_copy_n_result; ++ ++ } // namespace ranges ++ using std::uninitialized_move; ++ using std::uninitialized_move_n; ++ ++ namespace ranges { ++ using std::ranges::uninitialized_move; ++ using std::ranges::uninitialized_move_result; ++ ++ using std::ranges::uninitialized_move_n; ++ using std::ranges::uninitialized_move_n_result; ++ ++ } // namespace ranges ++ ++ using std::uninitialized_fill; ++ using std::uninitialized_fill_n; ++ ++ namespace ranges { ++ using std::ranges::uninitialized_fill; ++ using std::ranges::uninitialized_fill_n; ++ } // namespace ranges ++ ++ // [specialized.construct], construct_at ++ using std::construct_at; ++ ++ namespace ranges { ++ using std::ranges::construct_at; ++ } ++ // [specialized.destroy], destroy ++ using std::destroy; ++ using std::destroy_at; ++ using std::destroy_n; ++ ++ namespace ranges { ++ using std::ranges::destroy; ++ using std::ranges::destroy_at; ++ using std::ranges::destroy_n; ++ } // namespace ranges ++ // [unique.ptr], class template unique_ptr ++ using std::default_delete; ++ using std::unique_ptr; ++ ++ using std::make_unique; ++ using std::make_unique_for_overwrite; ++ ++ using std::swap; ++ ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++ using std::operator<=>; ++ ++ using std::operator<<; ++ ++ // [util.smartptr.weak.bad], class bad_weak_ptr ++ using std::bad_weak_ptr; ++ ++ // [util.smartptr.shared], class template shared_ptr ++ using std::shared_ptr; ++ ++ // [util.smartptr.shared.create], shared_ptr creation ++ using std::allocate_shared; ++ using std::allocate_shared_for_overwrite; ++ using std::make_shared; ++ using std::make_shared_for_overwrite; ++ ++ // [util.smartptr.shared.spec], shared_ptr specialized algorithms ++ using std::swap; ++ ++ // [util.smartptr.shared.cast], shared_ptr casts ++ using std::const_pointer_cast; ++ using std::dynamic_pointer_cast; ++ using std::reinterpret_pointer_cast; ++ using std::static_pointer_cast; ++ ++ using std::get_deleter; ++ ++ // [util.smartptr.shared.io], shared_ptr I/O ++ ++ // [util.smartptr.weak], class template weak_ptr ++ using std::weak_ptr; ++ ++ // [util.smartptr.weak.spec], weak_ptr specialized algorithms ++ ++ // [util.smartptr.ownerless], class template owner_less ++ using std::owner_less; ++ ++ // [util.smartptr.enab], class template enable_shared_from_this ++ using std::enable_shared_from_this; ++ ++ // [util.smartptr.hash], hash support ++ using std::hash; ++ ++ // [util.smartptr.atomic], atomic smart pointers ++ // Not implemented yet ++ // using std::atomic; ++ ++ // [out.ptr.t], class template out_ptr_t ++ // using std::out_ptr_t NOT IMPLEMENTED; ++ ++ // [out.ptr], function template out_ptr ++ // using std::out_ptr NOT IMPLEMENTED; ++ ++ // [inout.ptr.t], class template inout_ptr_t ++ // using std::inout_ptr_t NOT IMPLEMENTED; ++ ++ // [inout.ptr], function template inout_ptr ++ // using std::inout_ptr NOT IMPLEMENTED; ++ ++ // [depr.util.smartptr.shared.atomic] ++ using std::atomic_is_lock_free; ++ ++ using std::atomic_load; ++ using std::atomic_load_explicit; ++ ++ using std::atomic_store; ++ using std::atomic_store_explicit; ++ ++ using std::atomic_exchange; ++ using std::atomic_exchange_explicit; ++ ++ using std::atomic_compare_exchange_strong; ++ using std::atomic_compare_exchange_strong_explicit; ++ using std::atomic_compare_exchange_weak; ++ using std::atomic_compare_exchange_weak_explicit; ++ ++} // namespace std +diff --git a/libcxx/modules/std/memory_resource.cppm b/libcxx/modules/std/memory_resource.cppm +new file mode 100644 +index 000000000000..7e378dd7d844 +--- /dev/null ++++ b/libcxx/modules/std/memory_resource.cppm +@@ -0,0 +1,39 @@ ++// -*- 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:memory_resource; ++export namespace std::pmr { ++ ++ // [mem.res.class], class memory_resource ++ using std::pmr::memory_resource; ++ ++ using std::pmr::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++ // [mem.poly.allocator.class], class template polymorphic_allocator ++ using std::pmr::polymorphic_allocator; ++ ++ // [mem.res.global], global memory resources ++ using std::pmr::get_default_resource; ++ using std::pmr::new_delete_resource; ++ using std::pmr::null_memory_resource; ++ using std::pmr::set_default_resource; ++ ++ // [mem.res.pool], pool resource classes ++ using std::pmr::monotonic_buffer_resource; ++ using std::pmr::pool_options; ++ using std::pmr::synchronized_pool_resource; ++ using std::pmr::unsynchronized_pool_resource; ++ ++} // namespace std::pmr +diff --git a/libcxx/modules/std/mutex.cppm b/libcxx/modules/std/mutex.cppm +new file mode 100644 +index 000000000000..b61779ea0d74 +--- /dev/null ++++ b/libcxx/modules/std/mutex.cppm +@@ -0,0 +1,48 @@ ++// -*- 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:mutex; ++export namespace std { ++ ++ // [thread.mutex.class], class mutex ++ using std::mutex; ++ // [thread.mutex.recursive], class recursive_mutex ++ using std::recursive_mutex; ++ // [thread.timedmutex.class] class timed_mutex ++ using std::timed_mutex; ++ // [thread.timedmutex.recursive], class recursive_timed_mutex ++ using std::recursive_timed_mutex; ++ ++ using std::adopt_lock_t; ++ using std::defer_lock_t; ++ using std::try_to_lock_t; ++ ++ using std::adopt_lock; ++ using std::defer_lock; ++ using std::try_to_lock; ++ ++ // [thread.lock], locks ++ using std::lock_guard; ++ using std::scoped_lock; ++ using std::unique_lock; ++ ++ using std::swap; ++ ++ // [thread.lock.algorithm], generic locking algorithms ++ using std::lock; ++ using std::try_lock; ++ ++ using std::once_flag; ++ ++ using std::call_once; ++ ++} // namespace std +diff --git a/libcxx/modules/std/new.cppm b/libcxx/modules/std/new.cppm +new file mode 100644 +index 000000000000..23c8f12e4597 +--- /dev/null ++++ b/libcxx/modules/std/new.cppm +@@ -0,0 +1,48 @@ ++// -*- 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:__new; // Note new is a keyword and not a valid identifier ++export namespace std { ++ ++ // [alloc.errors], storage allocation errors ++ using std::bad_alloc; ++ using std::bad_array_new_length; ++ ++ using std::destroying_delete; ++ using std::destroying_delete_t; ++ ++ // global operator new control ++ using std::align_val_t; ++ ++ using std::nothrow; ++ using std::nothrow_t; ++ ++ using std::get_new_handler; ++ using std::new_handler; ++ using std::set_new_handler; ++ ++ // [ptr.launder], pointer optimization barrier ++ using std::launder; ++ ++#if 0 // This has not been implemented yet ++ // [hardware.interference], hardware interference size ++ using std::hardware_constructive_interference_size; ++ using std::hardware_destructive_interference_size; ++#endif ++} // namespace std ++ ++export { ++ using ::operator new; ++ using ::operator delete; ++ using ::operator new[]; ++ using ::operator delete[]; ++} // export +diff --git a/libcxx/modules/std/numbers.cppm b/libcxx/modules/std/numbers.cppm +new file mode 100644 +index 000000000000..d9d1d6561cab +--- /dev/null ++++ b/libcxx/modules/std/numbers.cppm +@@ -0,0 +1,56 @@ ++// -*- 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:numbers; ++export namespace std::numbers { ++ using std::numbers::e_v; ++ using std::numbers::egamma_v; ++ using std::numbers::inv_pi_v; ++ using std::numbers::inv_sqrt3_v; ++ using std::numbers::inv_sqrtpi_v; ++ using std::numbers::ln10_v; ++ using std::numbers::ln2_v; ++ using std::numbers::log10e_v; ++ using std::numbers::log2e_v; ++ using std::numbers::phi_v; ++ using std::numbers::pi_v; ++ using std::numbers::sqrt2_v; ++ using std::numbers::sqrt3_v; ++ ++ using std::numbers::e_v; ++ using std::numbers::egamma_v; ++ using std::numbers::inv_pi_v; ++ using std::numbers::inv_sqrt3_v; ++ using std::numbers::inv_sqrtpi_v; ++ using std::numbers::ln10_v; ++ using std::numbers::ln2_v; ++ using std::numbers::log10e_v; ++ using std::numbers::log2e_v; ++ using std::numbers::phi_v; ++ using std::numbers::pi_v; ++ using std::numbers::sqrt2_v; ++ using std::numbers::sqrt3_v; ++ ++ using std::numbers::e; ++ using std::numbers::egamma; ++ using std::numbers::inv_pi; ++ using std::numbers::inv_sqrt3; ++ using std::numbers::inv_sqrtpi; ++ using std::numbers::ln10; ++ using std::numbers::ln2; ++ using std::numbers::log10e; ++ using std::numbers::log2e; ++ using std::numbers::phi; ++ using std::numbers::pi; ++ using std::numbers::sqrt2; ++ using std::numbers::sqrt3; ++} // namespace std::numbers +diff --git a/libcxx/modules/std/numeric.cppm b/libcxx/modules/std/numeric.cppm +new file mode 100644 +index 000000000000..ec191a3b22e2 +--- /dev/null ++++ b/libcxx/modules/std/numeric.cppm +@@ -0,0 +1,63 @@ ++// -*- 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:numeric; ++export namespace std { ++ ++ // [accumulate], accumulate ++ using std::accumulate; ++ ++ // [reduce], reduce ++ using std::reduce; ++ ++ // [inner.product], inner product ++ using std::inner_product; ++ ++ // [transform.reduce], transform reduce ++ using std::transform_reduce; ++ ++ // [partial.sum], partial sum ++ using std::partial_sum; ++ ++ // [exclusive.scan], exclusive scan ++ using std::exclusive_scan; ++ ++ // [inclusive.scan], inclusive scan ++ using std::inclusive_scan; ++ ++ // [transform.exclusive.scan], transform exclusive scan ++ using std::transform_exclusive_scan; ++ ++ // [transform.inclusive.scan], transform inclusive scan ++ using std::transform_inclusive_scan; ++ ++ // [adjacent.difference], adjacent difference ++ using std::adjacent_difference; ++ ++ // [numeric.iota], iota ++ using std::iota; ++ ++ namespace ranges { ++ // using std::ranges::iota_result; NOT YET IMPLEMENTED ++ // using std::ranges::iota; NOT YET IMPLEMENTED ++ } // namespace ranges ++ ++ // [numeric.ops.gcd], greatest common divisor ++ using std::gcd; ++ ++ // [numeric.ops.lcm], least common multiple ++ using std::lcm; ++ ++ // [numeric.ops.midpoint], midpoint ++ using std::midpoint; ++ ++} // namespace std +diff --git a/libcxx/modules/std/optional.cppm b/libcxx/modules/std/optional.cppm +new file mode 100644 +index 000000000000..90734e9fb4a5 +--- /dev/null ++++ b/libcxx/modules/std/optional.cppm +@@ -0,0 +1,49 @@ ++// -*- 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:optional; ++export namespace std { ++ ++ // [optional.optional], class template optional ++ using std::optional; ++ ++ // [optional.nullopt], no-value state indicator ++ using std::nullopt; ++ using std::nullopt_t; ++ ++ // [optional.bad.access], class bad_optional_access ++ using std::bad_optional_access; ++ ++ // [optional.relops], relational operators ++ using std::operator==; ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#if 0 // P1614 ++ using std::operator<=>; ++#endif ++ ++ // [optional.nullops], comparison with nullopt ++ ++ // [optional.comp.with.t], comparison with T ++ ++ // [optional.specalg], specialized algorithms ++ using std::swap; ++ ++ using std::make_optional; ++ ++ // [optional.hash], hash support ++ using std::hash; ++ ++} // namespace std +diff --git a/libcxx/modules/std/ostream.cppm b/libcxx/modules/std/ostream.cppm +new file mode 100644 +index 000000000000..054757dde7a7 +--- /dev/null ++++ b/libcxx/modules/std/ostream.cppm +@@ -0,0 +1,47 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:ostream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::basic_ostream; ++ ++ using std::ostream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wostream; ++# endif ++ ++ using std::endl; ++ using std::ends; ++ using std::flush; ++ ++# if 0 ++ using std::emit_on_flush; ++ using std::flush_emit; ++ using std::noemit_on_flush; ++# endif ++ using std::operator<<; ++ ++# if 0 ++ // [ostream.formatted.print], print functions ++ using std::print; ++ using std::println; ++ ++ using std::vprint_nonunicode; ++ using std::vprint_unicode; ++# endif ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/print.cppm b/libcxx/modules/std/print.cppm +new file mode 100644 +index 000000000000..a7d8e27fb375 +--- /dev/null ++++ b/libcxx/modules/std/print.cppm +@@ -0,0 +1,27 @@ ++// -*- 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:print; ++export namespace std { ++#if 0 ++ // [print.fun], print functions ++ using std::print; ++ using std::println; ++ ++ using std::vprint_unicode; ++ ++ using std::vprint_nonunicode; ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/queue.cppm b/libcxx/modules/std/queue.cppm +new file mode 100644 +index 000000000000..bda18af7c657 +--- /dev/null ++++ b/libcxx/modules/std/queue.cppm +@@ -0,0 +1,39 @@ ++// -*- 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:queue; ++export namespace std { ++ ++ // [queue], class template queue ++ using std::queue; ++ ++ using std::operator==; ++#if 0 // P1614 ++ using std::operator<=>; ++#else ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#endif ++ ++ using std::swap; ++ using std::uses_allocator; ++ ++ // [priority.queue], class template priority_queue ++ using std::priority_queue; ++ ++ // Note formatter not in synopsis ++ // TODO Test whether the ommission fails tests. ++ ++} // namespace std +diff --git a/libcxx/modules/std/random.cppm b/libcxx/modules/std/random.cppm +new file mode 100644 +index 000000000000..5781f6e0f659 +--- /dev/null ++++ b/libcxx/modules/std/random.cppm +@@ -0,0 +1,119 @@ ++// -*- 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:random; ++export namespace std { ++ ++ // [rand.req.urng], uniform random bit generator requirements ++ using std::uniform_random_bit_generator; ++ ++ // [rand.eng.lcong], class template linear_congruential_engine ++ using std::linear_congruential_engine; ++ ++ // [rand.eng.mers], class template mersenne_twister_engine ++ using std::mersenne_twister_engine; ++ ++ // [rand.eng.sub], class template subtract_with_carry_engine ++ using std::subtract_with_carry_engine; ++ ++ // [rand.adapt.disc], class template discard_block_engine ++ using std::discard_block_engine; ++ ++ // [rand.adapt.ibits], class template independent_bits_engine ++ using std::independent_bits_engine; ++ ++ // [rand.adapt.shuf], class template shuffle_order_engine ++ using std::shuffle_order_engine; ++ ++ // [rand.predef], engines and engine adaptors with predefined parameters ++ using std::knuth_b; ++ using std::minstd_rand; ++ using std::minstd_rand0; ++ using std::mt19937; ++ using std::mt19937_64; ++ using std::ranlux24; ++ using std::ranlux24_base; ++ using std::ranlux48; ++ using std::ranlux48_base; ++ ++ using std::default_random_engine; ++ ++ // [rand.device], class random_device ++ using std::random_device; ++ ++ // [rand.util.seedseq], class seed_seq ++ using std::seed_seq; ++ ++ // [rand.util.canonical], function template generate_canonical ++ using std::generate_canonical; ++ ++ // [rand.dist.uni.int], class template uniform_int_distribution ++ using std::uniform_int_distribution; ++ ++ // [rand.dist.uni.real], class template uniform_real_distribution ++ using std::uniform_real_distribution; ++ ++ // [rand.dist.bern.bernoulli], class bernoulli_distribution ++ using std::bernoulli_distribution; ++ ++ // [rand.dist.bern.bin], class template binomial_distribution ++ using std::binomial_distribution; ++ ++ // [rand.dist.bern.geo], class template geometric_distribution ++ using std::geometric_distribution; ++ ++ // [rand.dist.bern.negbin], class template negative_binomial_distribution ++ using std::negative_binomial_distribution; ++ ++ // [rand.dist.pois.poisson], class template poisson_distribution ++ using std::poisson_distribution; ++ ++ // [rand.dist.pois.exp], class template exponential_distribution ++ using std::exponential_distribution; ++ ++ // [rand.dist.pois.gamma], class template gamma_distribution ++ using std::gamma_distribution; ++ ++ // [rand.dist.pois.weibull], class template weibull_distribution ++ using std::weibull_distribution; ++ ++ // [rand.dist.pois.extreme], class template extreme_value_distribution ++ using std::extreme_value_distribution; ++ ++ // [rand.dist.norm.normal], class template normal_distribution ++ using std::normal_distribution; ++ ++ // [rand.dist.norm.lognormal], class template lognormal_distribution ++ using std::lognormal_distribution; ++ ++ // [rand.dist.norm.chisq], class template chi_squared_distribution ++ using std::chi_squared_distribution; ++ ++ // [rand.dist.norm.cauchy], class template cauchy_distribution ++ using std::cauchy_distribution; ++ ++ // [rand.dist.norm.f], class template fisher_f_distribution ++ using std::fisher_f_distribution; ++ ++ // [rand.dist.norm.t], class template student_t_distribution ++ using std::student_t_distribution; ++ ++ // [rand.dist.samp.discrete], class template discrete_distribution ++ using std::discrete_distribution; ++ ++ // [rand.dist.samp.pconst], class template piecewise_constant_distribution ++ using std::piecewise_constant_distribution; ++ ++ // [rand.dist.samp.plinear], class template piecewise_linear_distribution ++ using std::piecewise_linear_distribution; ++ ++} // namespace std +diff --git a/libcxx/modules/std/ranges.cppm b/libcxx/modules/std/ranges.cppm +new file mode 100644 +index 000000000000..c8cbc9c24793 +--- /dev/null ++++ b/libcxx/modules/std/ranges.cppm +@@ -0,0 +1,343 @@ ++// -*- 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:ranges; ++export namespace std { ++ ++ namespace ranges { ++ ++ inline namespace __cpo { ++ // [range.access], range access ++ using std::ranges::__cpo::begin; ++ using std::ranges::__cpo::cbegin; ++ using std::ranges::__cpo::cend; ++ using std::ranges::__cpo::crbegin; ++ using std::ranges::__cpo::crend; ++ using std::ranges::__cpo::end; ++ using std::ranges::__cpo::rbegin; ++ using std::ranges::__cpo::rend; ++ ++ using std::ranges::__cpo::cdata; ++ using std::ranges::__cpo::data; ++ using std::ranges::__cpo::empty; ++ using std::ranges::__cpo::size; ++ using std::ranges::__cpo::ssize; ++ } // namespace __cpo ++ ++ // [range.range], ranges ++ using std::ranges::range; ++ ++ using std::ranges::enable_borrowed_range; ++ ++ using std::ranges::borrowed_range; ++ ++ // using std::ranges::const_iterator_t; NOT IMPLEMENTED YET ++ // using std::ranges::const_sentinel_t; NOT IMPLEMENTED YET ++ using std::ranges::iterator_t; ++ // using std::ranges::range_const_reference_t; NOT IMPLEMENTED YET ++ using std::ranges::range_common_reference_t; ++ using std::ranges::range_difference_t; ++ using std::ranges::range_reference_t; ++ using std::ranges::range_rvalue_reference_t; ++ using std::ranges::range_size_t; ++ using std::ranges::range_value_t; ++ using std::ranges::sentinel_t; ++ ++ // [range.sized], sized ranges ++ using std::ranges::disable_sized_range; ++ using std::ranges::sized_range; ++ ++ // [range.view], views ++ using std::ranges::enable_view; ++ using std::ranges::view; ++ using std::ranges::view_base; ++ ++ // [range.refinements], other range refinements ++ using std::ranges::bidirectional_range; ++ using std::ranges::common_range; ++ // using std::ranges::constant_range; NOT IMPLEMENTED YET ++ using std::ranges::contiguous_range; ++ using std::ranges::forward_range; ++ using std::ranges::input_range; ++ using std::ranges::output_range; ++ using std::ranges::random_access_range; ++ using std::ranges::viewable_range; ++ ++ // [view.interface], class template view_­interface ++ using std::ranges::view_interface; ++ ++ // [range.subrange], sub-ranges ++ using std::ranges::subrange; ++ using std::ranges::subrange_kind; ++ ++ using std::ranges::get; ++ ++ } // namespace ranges ++ ++ using std::ranges::get; ++ ++ namespace ranges { ++ ++ // [range.dangling], dangling iterator handling ++ using std::ranges::dangling; ++ ++ // [range.elementsof], class template elements_­of ++ // using std::ranges::elements_of; NOT IMPLEMENTED YET ++ ++ using std::ranges::borrowed_iterator_t; ++ ++ using std::ranges::borrowed_subrange_t; ++ ++ // [range.utility.conv], range conversions ++ // using std::ranges::to; NOT YET IMPLEMENTED ++ ++ // [range.empty], empty view ++ using std::ranges::empty_view; ++ ++ namespace views { ++ using std::ranges::views::empty; ++ } ++ ++ // [range.single], single view ++ using std::ranges::single_view; // freestanding ++ ++ namespace views { ++ using std::ranges::views::single; ++ } // namespace views ++ ++ // [range.iota], iota view ++ using std::ranges::iota_view; ++ ++ namespace views { ++ using std::ranges::views::iota; ++ } // namespace views ++ ++ // [range.repeat], repeat view ++#if 0 ++ using std::ranges::repeat_view; ++ ++ namespace views { ++ using std::ranges::views::repeat; ++ } // namespace views ++#endif ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++ // [range.istream], istream view ++ using std::ranges::basic_istream_view; ++ using std::ranges::istream_view; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::ranges::wistream_view; ++# endif ++ ++ namespace views { ++ using std::ranges::views::istream; ++ } ++#endif // _LIBCPP_HAS_NO_LOCALIZATION ++ ++ // [range.adaptor.object], range adaptor objects ++ // using std::ranges::range_adaptor_closure; NOT IMPLEMENTED YET ++ ++ // [range.all], all view ++ namespace views { ++ using std::ranges::views::all; ++ ++ using std::ranges::views::all_t; ++ } // namespace views ++ ++ // [range.ref.view], ref view ++ using std::ranges::ref_view; ++ ++ // [range.owning.view], owning view ++ using std::ranges::owning_view; ++ ++ // [range.as.rvalue], as rvalue view ++ using std::ranges::as_rvalue_view; ++ ++ namespace views { ++ using std::ranges::views::as_rvalue; ++ } // namespace views ++ ++ // [range.filter], filter view ++ using std::ranges::filter_view; ++ ++ namespace views { ++ using std::ranges::views::filter; ++ } // namespace views ++ ++ // [range.transform], transform view ++ using std::ranges::transform_view; ++ ++ namespace views { ++ using std::ranges::views::transform; ++ } // namespace views ++ ++ // [range.take], take view ++ using std::ranges::take_view; ++ ++ namespace views { ++ using std::ranges::views::take; ++ } // namespace views ++ ++ // [range.take.while], take while view ++ using std::ranges::take_while_view; ++ ++ namespace views { ++ using std::ranges::views::take_while; ++ } // namespace views ++ ++ // [range.drop], drop view ++ using std::ranges::drop_view; ++ ++ namespace views { ++ using std::ranges::views::drop; ++ } // namespace views ++ ++ // [range.drop.while], drop while view ++ using std::ranges::drop_while_view; ++ ++ namespace views { ++ using std::ranges::views::drop_while; ++ } // namespace views ++ ++ using std::ranges::join_view; ++ ++ namespace views { ++ using std::ranges::views::join; ++ } // namespace views ++#if 0 ++ using std::ranges::join_with_view; ++ ++ namespace views { ++ using std::ranges::views::join_with; ++ } // namespace views ++#endif ++ using std::ranges::lazy_split_view; ++ ++ // [range.split], split view ++ using std::ranges::split_view; ++ ++ namespace views { ++ using std::ranges::views::lazy_split; ++ using std::ranges::views::split; ++ } // namespace views ++ ++ // [range.counted], counted view ++ namespace views { ++ using std::ranges::views::counted; ++ } // namespace views ++ ++ // [range.common], common view ++ using std::ranges::common_view; ++ ++ namespace views { ++ using std::ranges::views::common; ++ } // namespace views ++ ++ // [range.reverse], reverse view ++ using std::ranges::reverse_view; ++ ++ namespace views { ++ using std::ranges::views::reverse; ++ } // namespace views ++ ++ // [range.as.const], as const view ++#if 0 ++ using std::ranges::as_const_view; ++ ++ namespace views { ++ using std::ranges::views::as_const; ++ } // namespace views ++#endif ++ // [range.elements], elements view ++ using std::ranges::elements_view; ++ ++ using std::ranges::keys_view; ++ using std::ranges::values_view; ++ ++ namespace views { ++ using std::ranges::views::elements; ++ using std::ranges::views::keys; ++ using std::ranges::views::values; ++ } // namespace views ++ ++ // [range.zip], zip view ++ using std::ranges::zip_view; ++ ++ namespace views { ++ using std::ranges::views::zip; ++ } // namespace views ++ ++ // [range.zip.transform], zip transform view ++#if 0 ++ using std::ranges::zip_transform_view; ++ ++ namespace views { ++ using std::ranges::views::zip_transform; ++ } ++ ++ using std::ranges::adjacent_view; ++ ++ namespace views { ++ using std::ranges::views::adjacent; ++ using std::ranges::views::pairwise; ++ } // namespace views ++ ++ using std::ranges::adjacent_transform_view; ++ ++ namespace views { ++ using std::ranges::views::adjacent_transform; ++ using std::ranges::views::pairwise_transform; ++ } // namespace views ++ ++ using std::ranges::chunk_view; ++ ++ using std::ranges::chunk_view; ++ ++ namespace views { ++ using std::ranges::views::chunk; ++ } ++ ++ using std::ranges::slide_view; ++ ++ namespace views { ++ using std::ranges::views::slide; ++ } ++ ++ // [range.chunk.by], chunk by view ++ using std::ranges::chunk_by_view; ++ ++ namespace views { ++ using std::ranges::views::chunk_by; ++ } ++ ++ // [range.stride], stride view ++ using std::ranges::stride_view; ++ ++ namespace views { ++ using std::ranges::views::stride; ++ } ++ ++ using std::ranges::cartesian_product_view; ++ ++ namespace views { ++ using std::ranges::views::cartesian_product; ++ } ++#endif ++ } // namespace ranges ++ ++ namespace views = ranges::views; ++ ++ using std::tuple_element; ++ using std::tuple_size; ++ ++ // using std::from_range_t; NOT IMPLEMENTED YET ++ ++} // namespace std +diff --git a/libcxx/modules/std/ratio.cppm b/libcxx/modules/std/ratio.cppm +new file mode 100644 +index 000000000000..5305f93cb1ec +--- /dev/null ++++ b/libcxx/modules/std/ratio.cppm +@@ -0,0 +1,64 @@ ++// -*- 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:ratio; ++export namespace std { ++ ++ // [ratio.ratio], class template ratio ++ using std::ratio; ++ ++ // [ratio.arithmetic], ratio arithmetic ++ using std::ratio_add; ++ using std::ratio_divide; ++ using std::ratio_multiply; ++ using std::ratio_subtract; ++ ++ // [ratio.comparison], ratio comparison ++ using std::ratio_equal; ++ using std::ratio_greater; ++ using std::ratio_greater_equal; ++ using std::ratio_less; ++ using std::ratio_less_equal; ++ using std::ratio_not_equal; ++ ++ using std::ratio_equal_v; ++ using std::ratio_greater_equal_v; ++ using std::ratio_greater_v; ++ using std::ratio_less_equal_v; ++ using std::ratio_less_v; ++ using std::ratio_not_equal_v; ++ ++ // [ratio.si], convenience SI typedefs ++ using std::atto; ++ using std::centi; ++ using std::deca; ++ using std::deci; ++ using std::exa; ++ using std::femto; ++ using std::giga; ++ using std::hecto; ++ using std::kilo; ++ using std::mega; ++ using std::micro; ++ using std::milli; ++ using std::nano; ++ using std::peta; ++ using std::pico; ++ using std::tera; ++ ++ // These are not supported by libc++, due to the range of intmax_t ++ // using std::yocto; ++ // using std::yotta; ++ // using std::zepto; ++ // using std::zetta ++ ++} // namespace std +diff --git a/libcxx/modules/std/regex.cppm b/libcxx/modules/std/regex.cppm +new file mode 100644 +index 000000000000..9b07dea5ba71 +--- /dev/null ++++ b/libcxx/modules/std/regex.cppm +@@ -0,0 +1,129 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:regex; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ // [re.const], regex constants ++ namespace regex_constants { ++ using std::regex_constants::error_type; ++ using std::regex_constants::match_flag_type; ++ using std::regex_constants::syntax_option_type; ++ ++ // regex_constants is a bitmask type. ++ // [bitmask.types] specified operators ++ using std::regex_constants::operator&; ++ using std::regex_constants::operator&=; ++ using std::regex_constants::operator^; ++ using std::regex_constants::operator^=; ++ using std::regex_constants::operator|; ++ using std::regex_constants::operator|=; ++ using std::regex_constants::operator~; ++ ++ } // namespace regex_constants ++ ++ // [re.badexp], class regex_error ++ using std::regex_error; ++ ++ // [re.traits], class template regex_traits ++ using std::regex_traits; ++ ++ // [re.regex], class template basic_regex ++ using std::basic_regex; ++ ++ using std::regex; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wregex; ++# endif ++ ++ // [re.regex.swap], basic_regex swap ++ using std::swap; ++ ++ // [re.submatch], class template sub_match ++ using std::sub_match; ++ ++ using std::csub_match; ++ using std::ssub_match; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wcsub_match; ++ using std::wssub_match; ++# endif ++ ++ // [re.submatch.op], sub_match non-member operators ++ using std::operator==; ++ using std::operator<=>; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++ using std::operator<<; ++ ++ // [re.results], class template match_results ++ using std::match_results; ++ ++ using std::cmatch; ++ using std::smatch; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wcmatch; ++ using std::wsmatch; ++# endif ++ ++ // match_results comparisons ++ ++ // [re.results.swap], match_results swap ++ ++ // [re.alg.match], function template regex_match ++ using std::regex_match; ++ ++ // [re.alg.search], function template regex_search ++ using std::regex_search; ++ ++ // [re.alg.replace], function template regex_replace ++ using std::regex_replace; ++ ++ // [re.regiter], class template regex_iterator ++ using std::regex_iterator; ++ ++ using std::cregex_iterator; ++ using std::sregex_iterator; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wcregex_iterator; ++ using std::wsregex_iterator; ++# endif ++ ++ // [re.tokiter], class template regex_token_iterator ++ using std::regex_token_iterator; ++ ++ using std::cregex_token_iterator; ++ using std::sregex_token_iterator; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wcregex_token_iterator; ++ using std::wsregex_token_iterator; ++# endif ++ ++ namespace pmr { ++ using std::pmr::match_results; ++ ++ using std::pmr::cmatch; ++ using std::pmr::smatch; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::pmr::wcmatch; ++ using std::pmr::wsmatch; ++# endif ++ } // namespace pmr ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/scoped_allocator.cppm b/libcxx/modules/std/scoped_allocator.cppm +new file mode 100644 +index 000000000000..595ef0f236aa +--- /dev/null ++++ b/libcxx/modules/std/scoped_allocator.cppm +@@ -0,0 +1,24 @@ ++// -*- 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:scoped_allocator; ++export namespace std { ++ // class template scoped_allocator_adaptor ++ using std::scoped_allocator_adaptor; ++ ++ // [scoped.adaptor.operators], scoped allocator operators ++ using std::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++} // namespace std +diff --git a/libcxx/modules/std/semaphore.cppm b/libcxx/modules/std/semaphore.cppm +new file mode 100644 +index 000000000000..7b81460ed263 +--- /dev/null ++++ b/libcxx/modules/std/semaphore.cppm +@@ -0,0 +1,19 @@ ++// -*- 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:semaphore; ++export namespace std { ++ // [thread.sema.cnt], class template counting_semaphore ++ using std::counting_semaphore; ++ ++ using std::binary_semaphore; ++} // namespace std +diff --git a/libcxx/modules/std/set.cppm b/libcxx/modules/std/set.cppm +new file mode 100644 +index 000000000000..4d43681358c2 +--- /dev/null ++++ b/libcxx/modules/std/set.cppm +@@ -0,0 +1,46 @@ ++// -*- 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:set; ++export namespace std { ++ // [set], class template set ++ using std::set; ++ ++ using std::operator==; ++#if 0 // P1614 ++ using std::operator<=>; ++#else ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#endif ++ ++ using std::swap; ++ ++ // [set.erasure], erasure for set ++ using std::erase_if; ++ ++ // [multiset], class template multiset ++ using std::multiset; ++ ++ // [multiset.erasure], erasure for multiset ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::set; ++ ++ using std::pmr::multiset; ++ } // namespace pmr ++ ++} // namespace std +diff --git a/libcxx/modules/std/shared_mutex.cppm b/libcxx/modules/std/shared_mutex.cppm +new file mode 100644 +index 000000000000..36c0f18399ae +--- /dev/null ++++ b/libcxx/modules/std/shared_mutex.cppm +@@ -0,0 +1,22 @@ ++// -*- 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:shared_mutex; ++export namespace std { ++ // [thread.sharedmutex.class], class shared_­mutex ++ using std::shared_mutex; ++ // [thread.sharedtimedmutex.class], class shared_­timed_­mutex ++ using std::shared_timed_mutex; ++ // [thread.lock.shared], class template shared_­lock ++ using std::shared_lock; ++ using std::swap; ++} // namespace std +diff --git a/libcxx/modules/std/source_location.cppm b/libcxx/modules/std/source_location.cppm +new file mode 100644 +index 000000000000..0f6aee59ddec +--- /dev/null ++++ b/libcxx/modules/std/source_location.cppm +@@ -0,0 +1,16 @@ ++// -*- 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:source_location; ++export namespace std { ++ using std::source_location; ++} // namespace std +diff --git a/libcxx/modules/std/span.cppm b/libcxx/modules/std/span.cppm +new file mode 100644 +index 000000000000..1d6f5530ebc7 +--- /dev/null ++++ b/libcxx/modules/std/span.cppm +@@ -0,0 +1,32 @@ ++// -*- 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:span; ++export namespace std { ++ ++ // constants ++ using std::dynamic_extent; ++ ++ // [views.span], class template span ++ using std::span; ++ ++ namespace ranges { ++ using std::ranges::enable_borrowed_range; ++ using std::ranges::enable_view; ++ } // namespace ranges ++ ++ // [span.objectrep], views of object representation ++ using std::as_bytes; ++ ++ using std::as_writable_bytes; ++ ++} // namespace std +diff --git a/libcxx/modules/std/spanstream.cppm b/libcxx/modules/std/spanstream.cppm +new file mode 100644 +index 000000000000..6106add97b3a +--- /dev/null ++++ b/libcxx/modules/std/spanstream.cppm +@@ -0,0 +1,49 @@ ++// -*- 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:spanstream; ++export namespace std { ++#if 0 ++ using std::basic_spanbuf; ++ ++ using std::swap; ++ ++ using std::spanbuf; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wspanbuf; ++# endif ++ ++ using std::basic_ispanstream; ++ ++ using std::ispanstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wispanstream; ++# endif ++ ++ using std::basic_ospanstream; ++ ++ using std::ospanstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wospanstream; ++# endif ++ ++ using std::basic_spanstream; ++ ++ using std::spanstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wspanstream; ++# endif ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/sstream.cppm b/libcxx/modules/std/sstream.cppm +new file mode 100644 +index 000000000000..d2ea74404663 +--- /dev/null ++++ b/libcxx/modules/std/sstream.cppm +@@ -0,0 +1,51 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:sstream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ ++ using std::basic_stringbuf; ++ ++ using std::swap; ++ ++ using std::stringbuf; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wstringbuf; ++# endif ++ ++ using std::basic_istringstream; ++ ++ using std::istringstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wistringstream; ++# endif ++ ++ using std::basic_ostringstream; ++ ++ using std::ostringstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wostringstream; ++# endif ++ ++ using std::basic_stringstream; ++ ++ using std::stringstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wstringstream; ++# endif ++ ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/stack.cppm b/libcxx/modules/std/stack.cppm +new file mode 100644 +index 000000000000..138833733a3b +--- /dev/null ++++ b/libcxx/modules/std/stack.cppm +@@ -0,0 +1,31 @@ ++// -*- 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:stack; ++export namespace std { ++ ++ // [stack], class template stack ++ using std::stack; ++ ++ using std::operator==; ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#if 0 // P1614 ++ using std::operator<=>; ++#endif ++ ++ using std::swap; ++ using std::uses_allocator; ++} // namespace std +diff --git a/libcxx/modules/std/stacktrace.cppm b/libcxx/modules/std/stacktrace.cppm +new file mode 100644 +index 000000000000..d91bd50d8410 +--- /dev/null ++++ b/libcxx/modules/std/stacktrace.cppm +@@ -0,0 +1,45 @@ ++// -*- 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:stacktrace; ++export namespace std { ++#if 0 ++ // [stacktrace.entry], class stacktrace_­entry ++ using std::stacktrace_entry; ++ ++ // [stacktrace.basic], class template basic_­stacktrace ++ using std::basic_stacktrace; ++ ++ // basic_­stacktrace typedef-names ++ using std::stacktrace; ++ ++ // [stacktrace.basic.nonmem], non-member functions ++ using std::swap; ++ ++ using std::to_string; ++ ++ using std::to_string; ++ ++ using std::operator<<; ++ using std::operator<<; ++ ++ namespace pmr { ++ using std::pmr::stacktrace; ++ } ++ ++ // [stacktrace.basic.hash], hash support ++ using std::hash; ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/stdexcept.cppm b/libcxx/modules/std/stdexcept.cppm +new file mode 100644 +index 000000000000..eb9e3e0562ca +--- /dev/null ++++ b/libcxx/modules/std/stdexcept.cppm +@@ -0,0 +1,25 @@ ++// -*- 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:stdexcept; ++export namespace std { ++ using std::domain_error; ++ using std::invalid_argument; ++ using std::length_error; ++ using std::logic_error; ++ using std::out_of_range; ++ using std::overflow_error; ++ using std::range_error; ++ using std::runtime_error; ++ using std::underflow_error; ++ ++} // namespace std +diff --git a/libcxx/modules/std/stdfloat.cppm b/libcxx/modules/std/stdfloat.cppm +new file mode 100644 +index 000000000000..5a9426696170 +--- /dev/null ++++ b/libcxx/modules/std/stdfloat.cppm +@@ -0,0 +1,34 @@ ++// -*- 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" ++# include ++#endif ++ ++export module std:stdfloat; ++export namespace std { ++#if defined(__STDCPP_FLOAT16_T__) ++ using std::float16_t; ++#endif ++#if defined(__STDCPP_FLOAT32_T__) ++ using std::float32_t; ++#endif ++#if defined(__STDCPP_FLOAT64_T__) ++ using std::float64_t; ++#endif ++#if defined(__STDCPP_FLOAT128_T__) ++ using std::float128_t; ++#endif ++#if defined(__STDCPP_BFLOAT16_T__) ++ using std::bfloat16_t; ++#endif ++ ++} // namespace std +diff --git a/libcxx/modules/std/stop_token.cppm b/libcxx/modules/std/stop_token.cppm +new file mode 100644 +index 000000000000..cc13db016445 +--- /dev/null ++++ b/libcxx/modules/std/stop_token.cppm +@@ -0,0 +1,32 @@ ++// -*- 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() // D145183 contains a patch for this header ++# error "include this header unconditionally and uncomment the exported symbols" ++# include ++#endif ++ ++export module std:stop_token; ++export namespace std { ++#if 0 ++ // [stoptoken], class stop_­token ++ using std::stop_token; ++ ++ // [stopsource], class stop_­source ++ using std::stop_source; ++ ++ // no-shared-stop-state indicator ++ using std::nostopstate; ++ using std::nostopstate_t; ++ ++ // [stopcallback], class template stop_­callback ++ using std::stop_callback; ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/streambuf.cppm b/libcxx/modules/std/streambuf.cppm +new file mode 100644 +index 000000000000..7b3d989fca81 +--- /dev/null ++++ b/libcxx/modules/std/streambuf.cppm +@@ -0,0 +1,25 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:streambuf; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ using std::basic_streambuf; ++ using std::streambuf; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wstreambuf; ++# endif ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/string.cppm b/libcxx/modules/std/string.cppm +new file mode 100644 +index 000000000000..f58bda1e378c +--- /dev/null ++++ b/libcxx/modules/std/string.cppm +@@ -0,0 +1,83 @@ ++// -*- 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:string; ++export namespace std { ++ ++ // [char.traits], character traits ++ using std::char_traits; ++ ++ // [basic.string], basic_string ++ using std::basic_string; ++ ++ using std::operator+; ++ using std::operator==; ++ using std::operator<=>; ++ ++ // [string.special], swap ++ using std::swap; ++ ++ // [string.io], inserters and extractors ++ using std::operator>>; ++ using std::operator<<; ++ using std::getline; ++ ++ // [string.erasure], erasure ++ using std::erase; ++ using std::erase_if; ++ ++ // basic_string typedef-names ++ using std::string; ++ using std::u16string; ++ using std::u32string; ++ using std::u8string; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wstring; ++#endif ++ ++ // [string.conversions], numeric conversions ++ using std::stod; ++ using std::stof; ++ using std::stoi; ++ using std::stol; ++ using std::stold; ++ using std::stoll; ++ using std::stoul; ++ using std::stoull; ++ using std::to_string; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::to_wstring; ++#endif ++ ++ namespace pmr { ++ using std::pmr::basic_string; ++ using std::pmr::string; ++ using std::pmr::u16string; ++ using std::pmr::u32string; ++ using std::pmr::u8string; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::pmr::wstring; ++#endif ++ ++ } // namespace pmr ++ ++ // [basic.string.hash], hash support ++ using std::hash; ++ ++ inline namespace literals { ++ inline namespace string_literals { ++ // [basic.string.literals], suffix for basic_string literals ++ using std::literals::string_literals::operator""s; ++ } // namespace string_literals ++ } // namespace literals ++ ++} // namespace std +diff --git a/libcxx/modules/std/string_view.cppm b/libcxx/modules/std/string_view.cppm +new file mode 100644 +index 000000000000..9f2e27d310ec +--- /dev/null ++++ b/libcxx/modules/std/string_view.cppm +@@ -0,0 +1,51 @@ ++// -*- 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:string_view; ++export namespace std { ++ ++ // [string.view.template], class template basic_string_view ++ using std::basic_string_view; ++ ++ namespace ranges { ++ using std::ranges::enable_borrowed_range; ++ using std::ranges::enable_view; ++ } // namespace ranges ++ ++ // [string.view.comparison], non-member comparison functions ++ using std::operator==; ++ using std::operator<=>; ++ ++ // see [string.view.comparison], sufficient additional overloads of comparison functions ++ ++ // [string.view.io], inserters and extractors ++ using std::operator<<; ++ ++ // basic_string_view typedef-names ++ using std::string_view; ++ using std::u16string_view; ++ using std::u32string_view; ++ using std::u8string_view; ++#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wstring_view; ++#endif ++ ++ // [string.view.hash], hash support ++ using std::hash; ++ ++ inline namespace literals { ++ inline namespace string_view_literals { ++ // [string.view.literals], suffix for basic_string_view literals ++ using std::literals::string_view_literals::operator"" sv; ++ } // namespace string_view_literals ++ } // namespace literals ++} // namespace std +diff --git a/libcxx/modules/std/strstream.cppm b/libcxx/modules/std/strstream.cppm +new file mode 100644 +index 000000000000..0f4fe7f6d004 +--- /dev/null ++++ b/libcxx/modules/std/strstream.cppm +@@ -0,0 +1,24 @@ ++// -*- 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> ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++# include ++#endif ++ ++export module std:strstream; ++#ifndef _LIBCPP_HAS_NO_LOCALIZATION ++export namespace std { ++ using std::istrstream; ++ using std::ostrstream; ++ using std::strstream; ++ using std::strstreambuf; ++} // namespace std ++#endif // _LIBCPP_HAS_NO_LOCALIZATION +diff --git a/libcxx/modules/std/syncstream.cppm b/libcxx/modules/std/syncstream.cppm +new file mode 100644 +index 000000000000..310f279d58bf +--- /dev/null ++++ b/libcxx/modules/std/syncstream.cppm +@@ -0,0 +1,35 @@ ++// -*- 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:syncstream; ++export namespace std { ++#if 0 ++ using std::basic_syncbuf; ++ ++ // [syncstream.syncbuf.special], specialized algorithms ++ using std::swap; ++ ++ using std::syncbuf; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wsyncbuf; ++# endif ++ using std::basic_osyncstream; ++ ++ using std::osyncstream; ++# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS ++ using std::wosyncstream; ++# endif ++#endif ++} // namespace std +diff --git a/libcxx/modules/std/system_error.cppm b/libcxx/modules/std/system_error.cppm +new file mode 100644 +index 000000000000..2f7f2ae111f2 +--- /dev/null ++++ b/libcxx/modules/std/system_error.cppm +@@ -0,0 +1,48 @@ ++// -*- 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:system_error; ++export namespace std { ++ ++ using std::error_category; ++ using std::generic_category; ++ using std::system_category; ++ ++ using std::error_code; ++ using std::error_condition; ++ using std::system_error; ++ ++ using std::is_error_code_enum; ++ using std::is_error_condition_enum; ++ ++ using std::errc; ++ ++ // [syserr.errcode.nonmembers], non-member functions ++ using std::make_error_code; ++ ++ using std::operator<<; ++ ++ // [syserr.errcondition.nonmembers], non-member functions ++ using std::make_error_condition; ++ ++ // [syserr.compare], comparison operator functions ++ using std::operator==; ++ using std::operator<=>; ++ ++ // [syserr.hash], hash support ++ using std::hash; ++ ++ // [syserr], system error support ++ using std::is_error_code_enum_v; ++ using std::is_error_condition_enum_v; ++ ++} // namespace std +diff --git a/libcxx/modules/std/thread.cppm b/libcxx/modules/std/thread.cppm +new file mode 100644 +index 000000000000..045242a960a0 +--- /dev/null ++++ b/libcxx/modules/std/thread.cppm +@@ -0,0 +1,41 @@ ++// -*- 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:thread; ++export namespace std { ++ // [thread.thread.class], class thread ++ using std::thread; ++ ++ using std::swap; ++ ++#if 0 // TODO Enable when implementing P0660 ++ // [thread.jthread.class], class jthread ++ using std::jthread; ++#endif ++ ++ // [thread.thread.this], namespace this_thread ++ namespace this_thread { ++ using std::this_thread::get_id; ++ ++ using std::this_thread::sleep_for; ++ using std::this_thread::sleep_until; ++ using std::this_thread::yield; ++ } // namespace this_thread ++ ++ // [thread.thread.id] ++ using std::operator==; ++ using std::operator<=>; ++ using std::operator<<; ++ using std::formatter; ++ using std::hash; ++ ++} // namespace std +diff --git a/libcxx/modules/std/tuple.cppm b/libcxx/modules/std/tuple.cppm +new file mode 100644 +index 000000000000..8990136f3ace +--- /dev/null ++++ b/libcxx/modules/std/tuple.cppm +@@ -0,0 +1,61 @@ ++// -*- 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:tuple; ++export namespace std { ++ ++ // [tuple.tuple], class template tuple ++ using std::tuple; ++ ++ // [tuple.like], concept tuple-like ++ ++ // [tuple.common.ref], common_reference related specializations ++ using std::basic_common_reference; ++ using std::common_type; ++ ++ // [tuple.creation], tuple creation functions ++ using std::ignore; ++ ++ using std::forward_as_tuple; ++ using std::make_tuple; ++ using std::tie; ++ using std::tuple_cat; ++ ++ // [tuple.apply], calling a function with a tuple of arguments ++ using std::apply; ++ ++ using std::make_from_tuple; ++ ++ // [tuple.helper], tuple helper classes ++ using std::tuple_element; ++ using std::tuple_size; ++ ++ using std::tuple_element_t; ++ ++ // [tuple.elem], element access ++ using std::get; ++ using std::tuple_element_t; ++ ++ // [tuple.rel], relational operators ++ using std::operator==; ++ using std::operator<=>; ++ ++ // [tuple.traits], allocator-related traits ++ using std::uses_allocator; ++ ++ // [tuple.special], specialized algorithms ++ using std::swap; ++ ++ // [tuple.helper], tuple helper classes ++ using std::tuple_size_v; ++ ++} // namespace std +diff --git a/libcxx/modules/std/type_traits.cppm b/libcxx/modules/std/type_traits.cppm +new file mode 100644 +index 000000000000..7a82cac9a9d7 +--- /dev/null ++++ b/libcxx/modules/std/type_traits.cppm +@@ -0,0 +1,339 @@ ++// -*- 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 ++#include ++export module std:type_traits; ++export namespace std { ++ ++ // [meta.help], helper class ++ using std::integral_constant; ++ ++ using std::bool_constant; ++ using std::false_type; ++ using std::true_type; ++ ++ // [meta.unary.cat], primary type categories ++ using std::is_array; ++ using std::is_class; ++ using std::is_enum; ++ using std::is_floating_point; ++ using std::is_function; ++ using std::is_integral; ++ using std::is_lvalue_reference; ++ using std::is_member_function_pointer; ++ using std::is_member_object_pointer; ++ using std::is_null_pointer; ++ using std::is_pointer; ++ using std::is_rvalue_reference; ++ using std::is_union; ++ using std::is_void; ++ ++ // [meta.unary.comp], composite type categories ++ using std::is_arithmetic; ++ using std::is_compound; ++ using std::is_fundamental; ++ using std::is_member_pointer; ++ using std::is_object; ++ using std::is_reference; ++ using std::is_scalar; ++ ++ // [meta.unary.prop], type properties ++ using std::is_abstract; ++ using std::is_aggregate; ++ using std::is_const; ++ using std::is_empty; ++ using std::is_final; ++ using std::is_polymorphic; ++ using std::is_standard_layout; ++ using std::is_trivial; ++ using std::is_trivially_copyable; ++ using std::is_volatile; ++ ++ using std::is_bounded_array; ++ using std::is_scoped_enum; ++ using std::is_signed; ++ using std::is_unbounded_array; ++ using std::is_unsigned; ++ ++ using std::is_constructible; ++ using std::is_copy_constructible; ++ using std::is_default_constructible; ++ using std::is_move_constructible; ++ ++ using std::is_assignable; ++ using std::is_copy_assignable; ++ using std::is_move_assignable; ++ ++ using std::is_swappable; ++ using std::is_swappable_with; ++ ++ using std::is_destructible; ++ ++ using std::is_trivially_constructible; ++ using std::is_trivially_copy_constructible; ++ using std::is_trivially_default_constructible; ++ using std::is_trivially_move_constructible; ++ ++ using std::is_trivially_assignable; ++ using std::is_trivially_copy_assignable; ++ using std::is_trivially_destructible; ++ using std::is_trivially_move_assignable; ++ ++ using std::is_nothrow_constructible; ++ using std::is_nothrow_copy_constructible; ++ using std::is_nothrow_default_constructible; ++ using std::is_nothrow_move_constructible; ++ ++ using std::is_nothrow_assignable; ++ using std::is_nothrow_copy_assignable; ++ using std::is_nothrow_move_assignable; ++ ++ using std::is_nothrow_swappable; ++ using std::is_nothrow_swappable_with; ++ ++ using std::is_nothrow_destructible; ++ ++#if 0 // IMPLEMENT ++ using std::is_implicit_lifetime; ++#endif ++ ++ using std::has_virtual_destructor; ++ ++ using std::has_unique_object_representations; ++ ++#if 0 // IMPLEMENT ++ using std::reference_constructs_from_temporary; ++ using std::reference_converts_from_temporary; ++#endif ++ ++ // [meta.unary.prop.query], type property queries ++ using std::alignment_of; ++ using std::extent; ++ using std::rank; ++ ++ // [meta.rel], type relations ++ using std::is_base_of; ++ using std::is_convertible; ++#if 0 // IMPLEMENT ++ using std::is_layout_compatible; ++#endif ++ using std::is_nothrow_convertible; ++#if 0 // IMPLEMENT ++ using std::is_pointer_interconvertible_base_of; ++#endif ++ using std::is_same; ++ ++ using std::is_invocable; ++ using std::is_invocable_r; ++ ++ using std::is_nothrow_invocable; ++ using std::is_nothrow_invocable_r; ++ ++ // [meta.trans.cv], const-volatile modifications ++ using std::add_const; ++ using std::add_cv; ++ using std::add_volatile; ++ using std::remove_const; ++ using std::remove_cv; ++ using std::remove_volatile; ++ ++ using std::add_const_t; ++ using std::add_cv_t; ++ using std::add_volatile_t; ++ using std::remove_const_t; ++ using std::remove_cv_t; ++ using std::remove_volatile_t; ++ ++ // [meta.trans.ref], reference modifications ++ using std::add_lvalue_reference; ++ using std::add_rvalue_reference; ++ using std::remove_reference; ++ ++ using std::add_lvalue_reference_t; ++ using std::add_rvalue_reference_t; ++ using std::remove_reference_t; ++ ++ // [meta.trans.sign], sign modifications ++ using std::make_signed; ++ using std::make_unsigned; ++ ++ using std::make_signed_t; ++ using std::make_unsigned_t; ++ ++ // [meta.trans.arr], array modifications ++ using std::remove_all_extents; ++ using std::remove_extent; ++ ++ using std::remove_all_extents_t; ++ using std::remove_extent_t; ++ ++ // [meta.trans.ptr], pointer modifications ++ using std::add_pointer; ++ using std::remove_pointer; ++ ++ using std::add_pointer_t; ++ using std::remove_pointer_t; ++ ++ // [meta.trans.other], other transformations ++ using std::basic_common_reference; ++ using std::common_reference; ++ using std::common_type; ++ using std::conditional; ++ using std::decay; ++ using std::enable_if; ++ using std::invoke_result; ++ using std::remove_cvref; ++ using std::type_identity; ++ using std::underlying_type; ++ using std::unwrap_ref_decay; ++ using std::unwrap_reference; ++ ++ using std::common_reference_t; ++ using std::common_type_t; ++ using std::conditional_t; ++ using std::decay_t; ++ using std::enable_if_t; ++ using std::invoke_result_t; ++ using std::remove_cvref_t; ++ using std::type_identity_t; ++ using std::underlying_type_t; ++ using std::unwrap_ref_decay_t; ++ using std::unwrap_reference_t; ++ using std::void_t; ++ ++ // [meta.logical], logical operator traits ++ using std::conjunction; ++ using std::disjunction; ++ using std::negation; ++ ++ // [meta.unary.cat], primary type categories ++ using std::is_array_v; ++ using std::is_class_v; ++ using std::is_enum_v; ++ using std::is_floating_point_v; ++ using std::is_function_v; ++ using std::is_integral_v; ++ using std::is_lvalue_reference_v; ++ using std::is_member_function_pointer_v; ++ using std::is_member_object_pointer_v; ++ using std::is_null_pointer_v; ++ using std::is_pointer_v; ++ using std::is_rvalue_reference_v; ++ using std::is_union_v; ++ using std::is_void_v; ++ ++ // [meta.unary.comp], composite type categories ++ using std::is_arithmetic_v; ++ using std::is_compound_v; ++ using std::is_fundamental_v; ++ using std::is_member_pointer_v; ++ using std::is_object_v; ++ using std::is_reference_v; ++ using std::is_scalar_v; ++ ++ // [meta.unary.prop], type properties ++ using std::has_unique_object_representations_v; ++ using std::has_virtual_destructor_v; ++ using std::is_abstract_v; ++ using std::is_aggregate_v; ++ using std::is_assignable_v; ++ using std::is_bounded_array_v; ++ using std::is_const_v; ++ using std::is_constructible_v; ++ using std::is_copy_assignable_v; ++ using std::is_copy_constructible_v; ++ using std::is_default_constructible_v; ++ using std::is_destructible_v; ++ using std::is_empty_v; ++ using std::is_final_v; ++#if 0 // IMPLEMENT ++ using std::is_implicit_lifetime_v; ++#endif ++ using std::is_move_assignable_v; ++ using std::is_move_constructible_v; ++ using std::is_nothrow_assignable_v; ++ using std::is_nothrow_constructible_v; ++ using std::is_nothrow_copy_assignable_v; ++ using std::is_nothrow_copy_constructible_v; ++ using std::is_nothrow_default_constructible_v; ++ using std::is_nothrow_destructible_v; ++ using std::is_nothrow_move_assignable_v; ++ using std::is_nothrow_move_constructible_v; ++ using std::is_nothrow_swappable_v; ++ using std::is_nothrow_swappable_with_v; ++ using std::is_polymorphic_v; ++ using std::is_scoped_enum_v; ++ using std::is_signed_v; ++ using std::is_standard_layout_v; ++ using std::is_swappable_v; ++ using std::is_swappable_with_v; ++ using std::is_trivial_v; ++ using std::is_trivially_assignable_v; ++ using std::is_trivially_constructible_v; ++ using std::is_trivially_copy_assignable_v; ++ using std::is_trivially_copy_constructible_v; ++ using std::is_trivially_copyable_v; ++ using std::is_trivially_default_constructible_v; ++ using std::is_trivially_destructible_v; ++ using std::is_trivially_move_assignable_v; ++ using std::is_trivially_move_constructible_v; ++ using std::is_unbounded_array_v; ++ using std::is_unsigned_v; ++ using std::is_volatile_v; ++#if 0 // IMPLEMENT ++ using std::reference_constructs_from_temporary_v; ++ using std::reference_converts_from_temporary_v; ++#endif ++ ++ // [meta.unary.prop.query], type property queries ++ using std::alignment_of_v; ++ using std::extent_v; ++ using std::rank_v; ++ ++ // [meta.rel], type relations ++ using std::is_base_of_v; ++ using std::is_convertible_v; ++ using std::is_invocable_r_v; ++ using std::is_invocable_v; ++#if 0 // IMPLEMENT ++ using std::is_layout_compatible_v; ++#endif ++ using std::is_nothrow_convertible_v; ++ using std::is_nothrow_invocable_r_v; ++ using std::is_nothrow_invocable_v; ++#if 0 // IMPLEMENT ++ using std::is_pointer_interconvertible_base_of_v; ++#endif ++ using std::is_same_v; ++ ++ // [meta.logical], logical operator traits ++ using std::conjunction_v; ++ using std::disjunction_v; ++ using std::negation_v; ++ ++ // [meta.member], member relationships ++#if 0 // IMPLEMENT ++ using std::is_corresponding_member; ++ using std::is_pointer_interconvertible_with_class; ++#endif ++ ++ // [meta.const.eval], constant evaluation context ++ using std::is_constant_evaluated; ++ ++ //[depr.meta.types] ++ using std::aligned_storage; ++ using std::aligned_storage_t; ++ using std::aligned_union; ++ using std::aligned_union_t; ++ using std::is_pod; ++ using std::is_pod_v; ++ ++} // namespace std +diff --git a/libcxx/modules/std/typeindex.cppm b/libcxx/modules/std/typeindex.cppm +new file mode 100644 +index 000000000000..386ed6bf4b43 +--- /dev/null ++++ b/libcxx/modules/std/typeindex.cppm +@@ -0,0 +1,17 @@ ++// -*- 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:typeindex; ++export namespace std { ++ using std::hash; ++ using std::type_index; ++} // namespace std +diff --git a/libcxx/modules/std/typeinfo.cppm b/libcxx/modules/std/typeinfo.cppm +new file mode 100644 +index 000000000000..39e6257a1fd4 +--- /dev/null ++++ b/libcxx/modules/std/typeinfo.cppm +@@ -0,0 +1,18 @@ ++// -*- 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:typeinfo; ++export namespace std { ++ using std::bad_cast; ++ using std::bad_typeid; ++ using std::type_info; ++} // namespace std +diff --git a/libcxx/modules/std/unordered_map.cppm b/libcxx/modules/std/unordered_map.cppm +new file mode 100644 +index 000000000000..d7bfcbf90496 +--- /dev/null ++++ b/libcxx/modules/std/unordered_map.cppm +@@ -0,0 +1,38 @@ ++// -*- 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:unordered_map; ++export namespace std { ++ // [unord.map], class template unordered_­map ++ using std::unordered_map; ++ ++ // [unord.multimap], class template unordered_­multimap ++ using std::unordered_multimap; ++ ++ using std::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++ using std::swap; ++ ++ // [unord.map.erasure], erasure for unordered_­map ++ using std::erase_if; ++ ++ // [unord.multimap.erasure], erasure for unordered_­multimap ++ ++ namespace pmr { ++ using std::pmr::unordered_map; ++ using std::pmr::unordered_multimap; ++ } // namespace pmr ++ ++} // namespace std +diff --git a/libcxx/modules/std/unordered_set.cppm b/libcxx/modules/std/unordered_set.cppm +new file mode 100644 +index 000000000000..95eca2ada2e8 +--- /dev/null ++++ b/libcxx/modules/std/unordered_set.cppm +@@ -0,0 +1,38 @@ ++// -*- 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:unordered_set; ++export namespace std { ++ // [unord.set], class template unordered_­set ++ using std::unordered_set; ++ ++ // [unord.multiset], class template unordered_­multiset ++ using std::unordered_multiset; ++ ++ using std::operator==; ++#if 1 // P1614 ++ using std::operator!=; ++#endif ++ ++ using std::swap; ++ ++ // [unord.set.erasure], erasure for unordered_­set ++ using std::erase_if; ++ ++ // [unord.multiset.erasure], erasure for unordered_­multiset ++ ++ namespace pmr { ++ using std::pmr::unordered_set; ++ ++ using std::pmr::unordered_multiset; ++ } // namespace pmr ++} // namespace std +diff --git a/libcxx/modules/std/utility.cppm b/libcxx/modules/std/utility.cppm +new file mode 100644 +index 000000000000..72c261015ebc +--- /dev/null ++++ b/libcxx/modules/std/utility.cppm +@@ -0,0 +1,100 @@ ++// -*- 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:utility; ++export namespace std { ++ // [utility.swap], swap ++ using std::swap; ++ ++ // [utility.exchange], exchange ++ using std::exchange; ++ ++ // [forward], forward/move ++ using std::forward; ++ using std::forward_like; ++ using std::move; ++ using std::move_if_noexcept; ++ ++ // [utility.as.const], as_const ++ using std::as_const; ++ ++ // [declval], declval ++ using std::declval; ++ ++ // [utility.intcmp], integer comparison functions ++ using std::cmp_equal; ++ using std::cmp_not_equal; ++ ++ using std::cmp_greater; ++ using std::cmp_greater_equal; ++ using std::cmp_less; ++ using std::cmp_less_equal; ++ ++ using std::in_range; ++ ++ // [utility.underlying], to_underlying ++ using std::to_underlying; ++ ++ // [utility.unreachable], unreachable ++ using std::unreachable; ++ ++ // [intseq], compile-time integer sequences ++ using std::index_sequence; ++ using std::integer_sequence; ++ ++ using std::make_index_sequence; ++ using std::make_integer_sequence; ++ ++ using std::index_sequence_for; ++ ++ // [pairs], class template pair ++ using std::pair; ++ ++ using std::basic_common_reference; ++ using std::common_type; ++ // [pairs.spec], pair specialized algorithms ++ using std::operator==; ++ using std::operator<=>; ++ ++ using std::make_pair; ++ ++ // [pair.astuple], tuple-like access to pair ++ using std::tuple_element; ++ using std::tuple_size; ++ ++ using std::tuple_element; ++ using std::tuple_size; ++ ++ using std::get; ++ ++ // [pair.piecewise], pair piecewise construction ++ using std::piecewise_construct; ++ using std::piecewise_construct_t; ++ ++ // in-place construction ++ using std::in_place; ++ using std::in_place_t; ++ ++ using std::in_place_type; ++ using std::in_place_type_t; ++ ++ using std::in_place_index; ++ using std::in_place_index_t; ++ ++ // [depr.relops] ++ namespace rel_ops { ++ using rel_ops::operator!=; ++ using rel_ops::operator>; ++ using rel_ops::operator<=; ++ using rel_ops::operator>=; ++ } // namespace rel_ops ++ ++} // namespace std +diff --git a/libcxx/modules/std/valarray.cppm b/libcxx/modules/std/valarray.cppm +new file mode 100644 +index 000000000000..39c5e95712bb +--- /dev/null ++++ b/libcxx/modules/std/valarray.cppm +@@ -0,0 +1,72 @@ ++// -*- 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:valarray; ++export namespace std { ++ using std::gslice; ++ using std::gslice_array; ++ using std::indirect_array; ++ using std::mask_array; ++ using std::slice; ++ using std::slice_array; ++ using std::valarray; ++ ++ using std::swap; ++ ++ using std::operator*; ++ using std::operator/; ++ using std::operator%; ++ using std::operator+; ++ using std::operator-; ++ ++ using std::operator^; ++ using std::operator&; ++ using std::operator|; ++ ++ using std::operator<<; ++ using std::operator>>; ++ ++ using std::operator&&; ++ using std::operator||; ++ ++ using std::operator==; ++ using std::operator!=; ++ ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++ ++ using std::abs; ++ using std::acos; ++ using std::asin; ++ using std::atan; ++ ++ using std::atan2; ++ ++ using std::cos; ++ using std::cosh; ++ using std::exp; ++ using std::log; ++ using std::log10; ++ ++ using std::pow; ++ ++ using std::sin; ++ using std::sinh; ++ using std::sqrt; ++ using std::tan; ++ using std::tanh; ++ ++ using std::begin; ++ using std::end; ++} // namespace std +diff --git a/libcxx/modules/std/variant.cppm b/libcxx/modules/std/variant.cppm +new file mode 100644 +index 000000000000..7e91dd6340ee +--- /dev/null ++++ b/libcxx/modules/std/variant.cppm +@@ -0,0 +1,56 @@ ++// -*- 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:variant; ++export namespace std { ++ // [variant.variant], class template variant ++ using std::variant; ++ ++ // [variant.helper], variant helper classes ++ using std::variant_alternative; ++ using std::variant_npos; ++ using std::variant_size; ++ using std::variant_size_v; ++ ++ // [variant.get], value access ++ using std::get; ++ using std::get_if; ++ using std::holds_alternative; ++ using std::variant_alternative_t; ++ ++ // [variant.relops], relational operators ++ using std::operator==; ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++ using std::operator<=>; ++ ++ // [variant.visit], visitation ++ using std::visit; ++ ++ // [variant.monostate], class monostate ++ using std::monostate; ++ ++ // [variant.monostate.relops], monostate relational operators ++ ++ // [variant.specalg], specialized algorithms ++ using std::swap; ++ ++ // [variant.bad.access], class bad_variant_access ++ using std::bad_variant_access; ++ ++ // [variant.hash], hash support ++ using std::hash; ++ ++} // namespace std +diff --git a/libcxx/modules/std/vector.cppm b/libcxx/modules/std/vector.cppm +new file mode 100644 +index 000000000000..fbf879c86a99 +--- /dev/null ++++ b/libcxx/modules/std/vector.cppm +@@ -0,0 +1,51 @@ ++// -*- 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 ++#include ++export module std:vector; ++ ++export namespace std { ++ // [vector], class template vector ++ using std::vector; ++ ++ using std::operator==; ++#if 0 // P1614 ++ using std::operator<=>; ++#else ++ /* These should be removed after https://reviews.llvm.org/D132268 lands. */ ++ using std::operator!=; ++ using std::operator<; ++ using std::operator>; ++ using std::operator<=; ++ using std::operator>=; ++#endif ++ ++ using std::swap; ++ ++ // [vector.erasure], erasure ++ using std::erase; ++ using std::erase_if; ++ ++ namespace pmr { ++ using std::pmr::vector; ++ } ++ ++ // [vector.bool], specialization of vector for bool ++ // [vector.bool.pspc], partial class template specialization vector ++ ++ // hash support ++ using std::hash; ++ ++ // [vector.bool.fmt], formatter specialization for vector ++ using std::formatter; ++} // namespace std ++ ++export { using ::operator new; } +diff --git a/libcxx/modules/std/version.cppm b/libcxx/modules/std/version.cppm +new file mode 100644 +index 000000000000..c2e8f09fec5b +--- /dev/null ++++ b/libcxx/modules/std/version.cppm +@@ -0,0 +1,16 @@ ++// -*- 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