1 # ===----------------------------------------------------------------------===##
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 # ===----------------------------------------------------------------------===##
12 import libcxx
.header_information
14 header_restrictions
= libcxx
.header_information
.header_restrictions
16 libcxx_include_directory
= os
.path
.join(
17 os
.path
.dirname(os
.path
.dirname(os
.path
.realpath(__file__
))), "include"
20 os
.path
.join(libcxx_include_directory
, "__std_clang_module"), "w"
21 ) as std_clang_module_header
:
22 std_clang_module_header
.write(
25 //===----------------------------------------------------------------------===//
27 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
28 // See https://llvm.org/LICENSE.txt for license information.
29 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
31 //===----------------------------------------------------------------------===//
33 // WARNING, this entire header is generated by
34 // utils/generate_std_clang_module_header.py
37 // This header should not be directly included, it's exclusively to import all
38 // of the libc++ public clang modules for the `std` clang module to export. In
39 // other words, it's to facilitate `@import std;` in Objective-C++ and `import std`
40 // in Swift to expose all of the libc++ interfaces. This is generally not
41 // recommended, however there are some clients that need to import all of libc++
42 // without knowing what "all" is.
43 #if !__building_module(std)
44 # error "Do not include this header directly, include individual headers instead"
49 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
50 # pragma GCC system_header
55 # Include the angle brackets in sorting so that <a.h> sorts before <a>
56 # like check-format wants.
57 for include
, header
in sorted([(f
"<{header}>", header
) for header
in libcxx
.header_information
.public_headers
]):
58 header_restriction
= header_restrictions
.get(header
)
59 if header_restriction
:
60 std_clang_module_header
.write(f
"#if {header_restriction}\n")
61 std_clang_module_header
.write(f
"# include {include}\n")
62 std_clang_module_header
.write(f
"#endif\n")
64 std_clang_module_header
.write(f
"#include {include}\n")