[libcxx-commits] [libcxx] Add some private headers to libcxx.imp (PR #89568)

Takuto Ikuta via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 22 00:54:20 PDT 2024


https://github.com/atetubou updated https://github.com/llvm/llvm-project/pull/89568

>From e0c4b64298c1552ba5c260875be13922d8fa2707 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Mon, 22 Apr 2024 16:49:32 +0900
Subject: [PATCH 1/2] git squash commit for update_libcxx_imp.

3971b55e6f80fe157a4aafe19dacd084f034807e
add top level headers starting from __ in libcxx.imp

3dcc3b7750395a05c943ecb5f065acfae1046e49
underscore
---
 libcxx/include/libcxx.imp                 | 13 +++++++++++++
 libcxx/utils/libcxx/header_information.py |  7 ++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

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"]
 ]

>From 0ac78d763c4a1c019c3e92385d30da64d35b6134 Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Mon, 22 Apr 2024 16:53:53 +0900
Subject: [PATCH 2/2] fmt

---
 libcxx/utils/libcxx/header_information.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libcxx/utils/libcxx/header_information.py b/libcxx/utils/libcxx/header_information.py
index 6ace7c10cd9537..f4083f1f725171 100644
--- a/libcxx/utils/libcxx/header_information.py
+++ b/libcxx/utils/libcxx/header_information.py
@@ -202,7 +202,9 @@ def is_modulemap_header(header):
     for p in include.glob("experimental/[a-z]*")
     if is_header(p)
 )
-public_headers = list(filter(lambda x: not x.startswith("__"), 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.
 #
@@ -210,8 +212,7 @@ def is_modulemap_header(header):
 module_headers = [
     header
     for header in toplevel_headers
-    if not header.endswith(".h")
-    and not header.startswith("__")
+    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"]
 ]



More information about the libcxx-commits mailing list