Skip to content

Commit ec2d5fd

Browse files
committed
git squash commit for update_libcxx_imp.
f9a8c46 git squash commit for update_libcxx_imp. e0c4b64 git squash commit for update_libcxx_imp. 3971b55 add top level headers starting from __ in libcxx.imp 3dcc3b7 underscore 0ac78d7 fmt 274337a is_public_header
1 parent da57609 commit ec2d5fd

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

libcxx/utils/libcxx/header_information.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ def is_header(file):
161161
]
162162

163163

164+
def is_public_header(header):
165+
return not header.startswith("__")
166+
167+
164168
def is_modulemap_header(header):
165169
"""Returns whether a header should be listed in the modulemap"""
166170
# TODO: Should `__config_site` be in the modulemap?
@@ -192,25 +196,26 @@ def is_modulemap_header(header):
192196
assert libcxx_root.exists()
193197

194198
all_headers = sorted(
195-
p.relative_to(include).as_posix() for p in include.rglob("[a-z]*") if is_header(p)
199+
p.relative_to(include).as_posix() for p in include.rglob("[_a-z]*") if is_header(p)
196200
)
197201
toplevel_headers = sorted(
198-
p.relative_to(include).as_posix() for p in include.glob("[a-z]*") if is_header(p)
202+
p.relative_to(include).as_posix() for p in include.glob("[_a-z]*") if is_header(p)
199203
)
200204
experimental_headers = sorted(
201205
p.relative_to(include).as_posix()
202206
for p in include.glob("experimental/[a-z]*")
203207
if is_header(p)
204208
)
205-
public_headers = toplevel_headers + experimental_headers
209+
210+
public_headers = [p for p in all_headers if is_public_header(p)]
206211

207212
# The headers used in the std and std.compat modules.
208213
#
209214
# This is the set of all C++23-and-later headers, excluding C compatibility headers.
210215
module_headers = [
211216
header
212217
for header in toplevel_headers
213-
if not header.endswith(".h")
218+
if not header.endswith(".h") and is_public_header(header)
214219
# These headers have been removed in C++20 so are never part of a module.
215220
and not header in ["ccomplex", "ciso646", "cstdbool", "ctgmath"]
216221
]

0 commit comments

Comments
 (0)