-
Notifications
You must be signed in to change notification settings - Fork 14.2k
[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
Conversation
@llvm/pr-subscribers-libcxx Author: Takuto Ikuta (atetubou) Changes#78295 dropped private headers in top level directory from libcxx.imp. This PR re-adds them to libcxx.imp. Full diff: https://github.com/llvm/llvm-project/pull/89568.diff 2 Files Affected:
diff --git a/libcxx/include/libcxx.imp b/libcxx/include/libcxx.imp
index a4e2690fc55c9a..6eb466f8a68a10 100644
--- a/libcxx/include/libcxx.imp
+++ b/libcxx/include/libcxx.imp
@@ -253,6 +253,8 @@
{ include: [ "<__bit/invert_if.h>", "private", "<bit>", "public" ] },
{ include: [ "<__bit/popcount.h>", "private", "<bit>", "public" ] },
{ include: [ "<__bit/rotate.h>", "private", "<bit>", "public" ] },
+ { include: [ "<__bit_reference>", "private", "<bitset>", "public" ] },
+ { include: [ "<__bit_reference>", "private", "<vector>", "public" ] },
{ include: [ "<__charconv/chars_format.h>", "private", "<charconv>", "public" ] },
{ include: [ "<__charconv/from_chars_integral.h>", "private", "<charconv>", "public" ] },
{ include: [ "<__charconv/from_chars_result.h>", "private", "<charconv>", "public" ] },
@@ -443,6 +445,8 @@
{ include: [ "<__fwd/subrange.h>", "private", "<ranges>", "public" ] },
{ include: [ "<__fwd/tuple.h>", "private", "<tuple>", "public" ] },
{ include: [ "<__fwd/vector.h>", "private", "<vector>", "public" ] },
+ { include: [ "<__hash_table>", "private", "<unordered_map>", "public" ] },
+ { include: [ "<__hash_table>", "private", "<unordered_set>", "public" ] },
{ include: [ "<__ios/fpos.h>", "private", "<ios>", "public" ] },
{ include: [ "<__iterator/access.h>", "private", "<iterator>", "public" ] },
{ include: [ "<__iterator/advance.h>", "private", "<iterator>", "public" ] },
@@ -486,6 +490,7 @@
{ include: [ "<__iterator/sortable.h>", "private", "<iterator>", "public" ] },
{ include: [ "<__iterator/unreachable_sentinel.h>", "private", "<iterator>", "public" ] },
{ include: [ "<__iterator/wrap_iter.h>", "private", "<iterator>", "public" ] },
+ { include: [ "<__locale>", "private", "<locale>", "public" ] },
{ include: [ "<__locale_dir/locale_base_api.h>", "private", "<locale>", "public" ] },
{ include: [ "<__locale_dir/locale_base_api/android.h>", "private", "<locale>", "public" ] },
{ include: [ "<__locale_dir/locale_base_api/bsd_locale_defaults.h>", "private", "<locale>", "public" ] },
@@ -562,6 +567,10 @@
{ include: [ "<__mutex/once_flag.h>", "private", "<mutex>", "public" ] },
{ include: [ "<__mutex/tag_types.h>", "private", "<mutex>", "public" ] },
{ include: [ "<__mutex/unique_lock.h>", "private", "<mutex>", "public" ] },
+ { include: [ "<__node_handle>", "private", "<map>", "public" ] },
+ { include: [ "<__node_handle>", "private", "<set>", "public" ] },
+ { include: [ "<__node_handle>", "private", "<unordered_map>", "public" ] },
+ { include: [ "<__node_handle>", "private", "<unordered_set>", "public" ] },
{ include: [ "<__numeric/accumulate.h>", "private", "<numeric>", "public" ] },
{ include: [ "<__numeric/adjacent_difference.h>", "private", "<numeric>", "public" ] },
{ include: [ "<__numeric/exclusive_scan.h>", "private", "<numeric>", "public" ] },
@@ -658,6 +667,8 @@
{ include: [ "<__ranges/view_interface.h>", "private", "<ranges>", "public" ] },
{ include: [ "<__ranges/views.h>", "private", "<ranges>", "public" ] },
{ include: [ "<__ranges/zip_view.h>", "private", "<ranges>", "public" ] },
+ { include: [ "<__split_buffer>", "private", "<deque>", "public" ] },
+ { include: [ "<__split_buffer>", "private", "<vector>", "public" ] },
{ include: [ "<__stop_token/atomic_unique_lock.h>", "private", "<stop_token>", "public" ] },
{ include: [ "<__stop_token/intrusive_list_view.h>", "private", "<stop_token>", "public" ] },
{ include: [ "<__stop_token/intrusive_shared_ptr.h>", "private", "<stop_token>", "public" ] },
@@ -700,6 +711,8 @@
{ include: [ "<__thread/this_thread.h>", "private", "<thread>", "public" ] },
{ include: [ "<__thread/thread.h>", "private", "<thread>", "public" ] },
{ include: [ "<__thread/timed_backoff_policy.h>", "private", "<thread>", "public" ] },
+ { include: [ "<__tree>", "private", "<map>", "public" ] },
+ { include: [ "<__tree>", "private", "<set>", "public" ] },
{ include: [ "<__tuple/find_index.h>", "private", "<tuple>", "public" ] },
{ include: [ "<__tuple/make_tuple_types.h>", "private", "<tuple>", "public" ] },
{ include: [ "<__tuple/sfinae_helpers.h>", "private", "<tuple>", "public" ] },
diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py
index bccae353b0c6bd..6ace7c10cd9537 100644
--- a/libcxx/utils/libcxx/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -192,17 +192,17 @@ 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 = list(filter(lambda x: not x.startswith("__"), toplevel_headers + experimental_headers))
# The headers used in the std and std.compat modules.
#
@@ -211,6 +211,7 @@ def is_modulemap_header(header):
header
for header in toplevel_headers
if not header.endswith(".h")
+ and not header.startswith("__")
# These headers have been removed in C++20 so are never part of a module.
and not header in ["ccomplex", "ciso646", "cstdbool", "ctgmath"]
]
|
@ldionne @philnik777 could you take a look this PR? |
✅ With the latest revision this PR passed the Python code formatter. |
3dcc3b7
to
0ac78d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase onto main
, I just landed a change this morning that doesn't check-in the .imp
file anymore.
Thanks for the patch and noticing this issue!
0ac78d7
to
274337a
Compare
274337a
to
7fbdb14
Compare
@@ -161,6 +161,10 @@ def is_header(file): | |||
] | |||
|
|||
|
|||
def is_public_header(header): | |||
return "__" not in header and not header.startswith("ext/") |
There was a problem hiding this comment.
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.
Thank you for review! |
#78295 dropped private headers in top level directory from libcxx.imp.
This PR re-adds them to libcxx.imp.