Skip to content

Commit 274337a

Browse files
committed
is_public_header
1 parent f9a8c46 commit 274337a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

libcxx/utils/libcxx/header_information.py

Lines changed: 7 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?
@@ -202,17 +206,16 @@ def is_modulemap_header(header):
202206
for p in include.glob("experimental/[a-z]*")
203207
if is_header(p)
204208
)
205-
public_headers = list(
206-
filter(lambda x: not x.startswith("__"), toplevel_headers + experimental_headers)
207-
)
209+
210+
public_headers = [p for p in all_headers if is_public_header(p)]
208211

209212
# The headers used in the std and std.compat modules.
210213
#
211214
# This is the set of all C++23-and-later headers, excluding C compatibility headers.
212215
module_headers = [
213216
header
214217
for header in toplevel_headers
215-
if not header.endswith(".h") and not header.startswith("__")
218+
if not header.endswith(".h") and is_public_header(header)
216219
# These headers have been removed in C++20 so are never part of a module.
217220
and not header in ["ccomplex", "ciso646", "cstdbool", "ctgmath"]
218221
]

0 commit comments

Comments
 (0)