Skip to content

[libc++] Add some private headers to libcxx.imp #89568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions libcxx/utils/libcxx/header_information.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def is_header(file):
]


def is_public_header(header):
return "__" not in header and not header.startswith("ext/")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not header.startswith("ext/") is to prevent appearing ext/* headers in
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__std_clang_module

But I'm not sure that is intentional or not.



def is_modulemap_header(header):
"""Returns whether a header should be listed in the modulemap"""
# TODO: Should `__config_site` be in the modulemap?
Expand Down Expand Up @@ -192,25 +196,26 @@ def is_modulemap_header(header):
assert libcxx_root.exists()

all_headers = sorted(
p.relative_to(include).as_posix() for p in include.rglob("[a-z]*") if is_header(p)
p.relative_to(include).as_posix() for p in include.rglob("[_a-z]*") if is_header(p)
)
toplevel_headers = sorted(
p.relative_to(include).as_posix() for p in include.glob("[a-z]*") if is_header(p)
p.relative_to(include).as_posix() for p in include.glob("[_a-z]*") if is_header(p)
)
experimental_headers = sorted(
p.relative_to(include).as_posix()
for p in include.glob("experimental/[a-z]*")
if is_header(p)
)
public_headers = toplevel_headers + experimental_headers

public_headers = [p for p in all_headers if is_public_header(p)]

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