Index: libcxx/include/CMakeLists.txt =================================================================== --- libcxx/include/CMakeLists.txt +++ libcxx/include/CMakeLists.txt @@ -540,14 +540,14 @@ __thread/timed_backoff_policy.h __threading_support __tree - __tuple/apply_cv.h - __tuple/make_tuple_types.h - __tuple/sfinae_helpers.h - __tuple/tuple_element.h - __tuple/tuple_indices.h - __tuple/tuple_like.h - __tuple/tuple_size.h - __tuple/tuple_types.h + __tuple_dir/apply_cv.h + __tuple_dir/make_tuple_types.h + __tuple_dir/sfinae_helpers.h + __tuple_dir/tuple_element.h + __tuple_dir/tuple_indices.h + __tuple_dir/tuple_like.h + __tuple_dir/tuple_size.h + __tuple_dir/tuple_types.h __type_traits/add_const.h __type_traits/add_cv.h __type_traits/add_lvalue_reference.h Index: libcxx/include/__functional/hash.h =================================================================== --- libcxx/include/__functional/hash.h +++ libcxx/include/__functional/hash.h @@ -12,7 +12,7 @@ #include <__config> #include <__functional/unary_function.h> #include <__fwd/hash.h> -#include <__tuple/sfinae_helpers.h> +#include <__tuple_dir/sfinae_helpers.h> #include <__utility/forward.h> #include <__utility/move.h> #include <__utility/pair.h> Index: libcxx/include/__fwd/get.h =================================================================== --- libcxx/include/__fwd/get.h +++ libcxx/include/__fwd/get.h @@ -13,7 +13,7 @@ #include <__fwd/array.h> #include <__fwd/pair.h> #include <__fwd/tuple.h> -#include <__tuple/tuple_element.h> +#include <__tuple_dir/tuple_element.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) Index: libcxx/include/__memory/compressed_pair.h =================================================================== --- libcxx/include/__memory/compressed_pair.h +++ libcxx/include/__memory/compressed_pair.h @@ -13,7 +13,7 @@ #include <__config> #include <__fwd/get.h> #include <__fwd/tuple.h> -#include <__tuple/tuple_indices.h> +#include <__tuple_dir/tuple_indices.h> #include <__type_traits/dependent_type.h> #include <__utility/forward.h> #include <__utility/move.h> Index: libcxx/include/__ranges/subrange.h =================================================================== --- libcxx/include/__ranges/subrange.h +++ libcxx/include/__ranges/subrange.h @@ -28,8 +28,8 @@ #include <__ranges/enable_borrowed_range.h> #include <__ranges/size.h> #include <__ranges/view_interface.h> -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_size.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_size.h> #include <__utility/move.h> #include Index: libcxx/include/__tuple_dir/make_tuple_types.h =================================================================== --- libcxx/include/__tuple_dir/make_tuple_types.h +++ libcxx/include/__tuple_dir/make_tuple_types.h @@ -12,11 +12,11 @@ #include <__config> #include <__fwd/array.h> #include <__fwd/tuple.h> -#include <__tuple/apply_cv.h> -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_indices.h> -#include <__tuple/tuple_size.h> -#include <__tuple/tuple_types.h> +#include <__tuple_dir/apply_cv.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_indices.h> +#include <__tuple_dir/tuple_size.h> +#include <__tuple_dir/tuple_types.h> #include <__type_traits/remove_cv.h> #include <__type_traits/remove_reference.h> #include Index: libcxx/include/__tuple_dir/sfinae_helpers.h =================================================================== --- libcxx/include/__tuple_dir/sfinae_helpers.h +++ libcxx/include/__tuple_dir/sfinae_helpers.h @@ -11,11 +11,11 @@ #include <__config> #include <__fwd/tuple.h> -#include <__tuple/make_tuple_types.h> -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_like.h> -#include <__tuple/tuple_size.h> -#include <__tuple/tuple_types.h> +#include <__tuple_dir/make_tuple_types.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_like.h> +#include <__tuple_dir/tuple_size.h> +#include <__tuple_dir/tuple_types.h> #include <__type_traits/enable_if.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_assignable.h> Index: libcxx/include/__tuple_dir/tuple_element.h =================================================================== --- libcxx/include/__tuple_dir/tuple_element.h +++ libcxx/include/__tuple_dir/tuple_element.h @@ -10,8 +10,8 @@ #define _LIBCPP___TUPLE_TUPLE_ELEMENT_H #include <__config> -#include <__tuple/tuple_indices.h> -#include <__tuple/tuple_types.h> +#include <__tuple_dir/tuple_indices.h> +#include <__tuple_dir/tuple_types.h> #include <__type_traits/add_const.h> #include <__type_traits/add_cv.h> #include <__type_traits/add_volatile.h> Index: libcxx/include/__tuple_dir/tuple_like.h =================================================================== --- libcxx/include/__tuple_dir/tuple_like.h +++ libcxx/include/__tuple_dir/tuple_like.h @@ -13,7 +13,7 @@ #include <__fwd/array.h> #include <__fwd/pair.h> #include <__fwd/tuple.h> -#include <__tuple/tuple_types.h> +#include <__tuple_dir/tuple_types.h> #include <__type_traits/integral_constant.h> #include Index: libcxx/include/__tuple_dir/tuple_size.h =================================================================== --- libcxx/include/__tuple_dir/tuple_size.h +++ libcxx/include/__tuple_dir/tuple_size.h @@ -11,7 +11,7 @@ #include <__config> #include <__fwd/tuple.h> -#include <__tuple/tuple_types.h> +#include <__tuple_dir/tuple_types.h> #include <__type_traits/is_const.h> #include <__type_traits/is_volatile.h> #include Index: libcxx/include/__utility/pair.h =================================================================== --- libcxx/include/__utility/pair.h +++ libcxx/include/__utility/pair.h @@ -15,10 +15,10 @@ #include <__functional/unwrap_ref.h> #include <__fwd/get.h> #include <__fwd/tuple.h> -#include <__tuple/sfinae_helpers.h> -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_indices.h> -#include <__tuple/tuple_size.h> +#include <__tuple_dir/sfinae_helpers.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_indices.h> +#include <__tuple_dir/tuple_size.h> #include <__type_traits/is_implicitly_default_constructible.h> #include <__utility/forward.h> #include <__utility/move.h> Index: libcxx/include/array =================================================================== --- libcxx/include/array +++ libcxx/include/array @@ -115,7 +115,7 @@ #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__iterator/reverse_iterator.h> -#include <__tuple/sfinae_helpers.h> +#include <__tuple_dir/sfinae_helpers.h> #include <__utility/integer_sequence.h> #include <__utility/move.h> #include <__utility/unreachable.h> @@ -137,8 +137,8 @@ #include // [tuple.helper] -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_size.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_size.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header Index: libcxx/include/libcxx.imp =================================================================== --- libcxx/include/libcxx.imp +++ libcxx/include/libcxx.imp @@ -39,7 +39,7 @@ { include: [ "@<__string/.*>", "private", "", "public" ] }, { include: [ "@<__support/.*>", "private", "", "public" ] }, { include: [ "@<__thread/.*>", "private", "", "public" ] }, - { include: [ "@<__tuple/.*>", "private", "", "public" ] }, + { include: [ "@<__tuple_dir/.*>", "private", "", "public" ] }, { include: [ "@<__type_traits/.*>", "private", "", "public" ] }, { include: [ "@<__utility/.*>", "private", "", "public" ] }, { include: [ "@<__variant/.*>", "private", "", "public" ] }, Index: libcxx/include/module.modulemap.in =================================================================== --- libcxx/include/module.modulemap.in +++ libcxx/include/module.modulemap.in @@ -1342,16 +1342,16 @@ header "tuple" export * - module apply_cv { private header "__tuple/apply_cv.h" } + module apply_cv { private header "__tuple_dir/apply_cv.h" } module get_fwd { private header "__fwd/get.h" } - module make_tuple_types { private header "__tuple/make_tuple_types.h" } - module sfinae_helpers { private header "__tuple/sfinae_helpers.h" } - module tuple_element { private header "__tuple/tuple_element.h" } + module make_tuple_types { private header "__tuple_dir/make_tuple_types.h" } + module sfinae_helpers { private header "__tuple_dir/sfinae_helpers.h" } + module tuple_element { private header "__tuple_dir/tuple_element.h" } module tuple_fwd { private header "__fwd/tuple.h" } - module tuple_indices { private header "__tuple/tuple_indices.h" } - module tuple_like { private header "__tuple/tuple_like.h" } - module tuple_size { private header "__tuple/tuple_size.h" } - module tuple_types { private header "__tuple/tuple_types.h" } + module tuple_indices { private header "__tuple_dir/tuple_indices.h" } + module tuple_like { private header "__tuple_dir/tuple_like.h" } + module tuple_size { private header "__tuple_dir/tuple_size.h" } + module tuple_types { private header "__tuple_dir/tuple_types.h" } } module type_traits { header "type_traits" Index: libcxx/include/optional =================================================================== --- libcxx/include/optional +++ libcxx/include/optional @@ -166,7 +166,7 @@ #include <__functional/invoke.h> #include <__functional/unary_function.h> #include <__memory/construct_at.h> -#include <__tuple/sfinae_helpers.h> +#include <__tuple_dir/sfinae_helpers.h> #include <__utility/forward.h> #include <__utility/in_place.h> #include <__utility/move.h> Index: libcxx/include/ranges =================================================================== --- libcxx/include/ranges +++ libcxx/include/ranges @@ -352,8 +352,8 @@ #include // [tuple.helper] -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_size.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_size.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header Index: libcxx/include/utility =================================================================== --- libcxx/include/utility +++ libcxx/include/utility @@ -267,8 +267,8 @@ #include // [tuple.helper] -#include <__tuple/tuple_element.h> -#include <__tuple/tuple_size.h> +#include <__tuple_dir/tuple_element.h> +#include <__tuple_dir/tuple_size.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header Index: libcxx/test/libcxx/private_headers.verify.cpp =================================================================== --- libcxx/test/libcxx/private_headers.verify.cpp +++ libcxx/test/libcxx/private_headers.verify.cpp @@ -553,14 +553,14 @@ #include <__string/extern_template_lists.h> // expected-error@*:* {{use of private header from outside its module: '__string/extern_template_lists.h'}} #include <__thread/poll_with_backoff.h> // expected-error@*:* {{use of private header from outside its module: '__thread/poll_with_backoff.h'}} #include <__thread/timed_backoff_policy.h> // expected-error@*:* {{use of private header from outside its module: '__thread/timed_backoff_policy.h'}} -#include <__tuple/apply_cv.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/apply_cv.h'}} -#include <__tuple/make_tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/make_tuple_types.h'}} -#include <__tuple/sfinae_helpers.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/sfinae_helpers.h'}} -#include <__tuple/tuple_element.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_element.h'}} -#include <__tuple/tuple_indices.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_indices.h'}} -#include <__tuple/tuple_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_like.h'}} -#include <__tuple/tuple_size.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_size.h'}} -#include <__tuple/tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple/tuple_types.h'}} +#include <__tuple_dir/apply_cv.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/apply_cv.h'}} +#include <__tuple_dir/make_tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/make_tuple_types.h'}} +#include <__tuple_dir/sfinae_helpers.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/sfinae_helpers.h'}} +#include <__tuple_dir/tuple_element.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_element.h'}} +#include <__tuple_dir/tuple_indices.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_indices.h'}} +#include <__tuple_dir/tuple_like.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_like.h'}} +#include <__tuple_dir/tuple_size.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_size.h'}} +#include <__tuple_dir/tuple_types.h> // expected-error@*:* {{use of private header from outside its module: '__tuple_dir/tuple_types.h'}} #include <__type_traits/add_const.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_const.h'}} #include <__type_traits/add_cv.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_cv.h'}} #include <__type_traits/add_lvalue_reference.h> // expected-error@*:* {{use of private header from outside its module: '__type_traits/add_lvalue_reference.h'}} Index: libcxx/utils/generate_iwyu_mapping.py =================================================================== --- libcxx/utils/generate_iwyu_mapping.py +++ libcxx/utils/generate_iwyu_mapping.py @@ -31,7 +31,10 @@ result = [] for i in detail_directories: - result.append(f'{generate(f"@<{i}/.*>", i[2:])},') + rhs = i[2:] + if rhs.endswith('_dir'): + rhs = rhs[:-4] + result.append(f'{generate(f"@<{i}/.*>", rhs)},') for i in detail_files: public = []