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

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 21 21:28:34 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Takuto Ikuta (atetubou)

<details>
<summary>Changes</summary>

https://github.com/llvm/llvm-project/pull/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:

- (modified) libcxx/include/libcxx.imp (+13) 
- (modified) libcxx/utils/libcxx/header_information.py (+4-3) 


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

``````````

</details>


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


More information about the libcxx-commits mailing list