[libcxx-commits] [libcxx] eb0f121 - [libc++][modules] Tweak a few includes (#107467)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 6 09:10:09 PDT 2024


Author: Louis Dionne
Date: 2024-09-06T12:10:04-04:00
New Revision: eb0f12188a3afa10ba353a32328577dc0d898524

URL: https://github.com/llvm/llvm-project/commit/eb0f12188a3afa10ba353a32328577dc0d898524
DIFF: https://github.com/llvm/llvm-project/commit/eb0f12188a3afa10ba353a32328577dc0d898524.diff

LOG: [libc++][modules] Tweak a few includes (#107467)

Add a few missing includes, remove two unnecessary ones and use
__cstddef/size_t.h instead of <cstddef> in a few places. This is a
collection of miscellaneous findings that collectively unblock other
modularization patches.

Added: 
    

Modified: 
    libcxx/include/__math/copysign.h
    libcxx/include/__math/remainder.h
    libcxx/include/__tuple/find_index.h
    libcxx/include/__tuple/make_tuple_types.h
    libcxx/include/__tuple/sfinae_helpers.h
    libcxx/include/__tuple/tuple_element.h
    libcxx/include/__tuple/tuple_indices.h
    libcxx/include/__tuple/tuple_like_ext.h
    libcxx/include/__tuple/tuple_like_no_subrange.h
    libcxx/include/__tuple/tuple_size.h
    libcxx/include/future
    libcxx/include/variant
    libcxx/test/libcxx/transitive_includes/cxx11.csv
    libcxx/test/libcxx/transitive_includes/cxx14.csv
    libcxx/test/libcxx/transitive_includes/cxx17.csv
    libcxx/test/libcxx/transitive_includes/cxx20.csv
    libcxx/test/libcxx/transitive_includes/cxx23.csv
    libcxx/test/libcxx/transitive_includes/cxx26.csv

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__math/copysign.h b/libcxx/include/__math/copysign.h
index b38690bb581a11..2c3b0dd6f97b70 100644
--- a/libcxx/include/__math/copysign.h
+++ b/libcxx/include/__math/copysign.h
@@ -13,7 +13,6 @@
 #include <__type_traits/enable_if.h>
 #include <__type_traits/is_arithmetic.h>
 #include <__type_traits/promote.h>
-#include <limits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__math/remainder.h b/libcxx/include/__math/remainder.h
index 0fbf0b8ef97b9e..0adb7f3af5de2c 100644
--- a/libcxx/include/__math/remainder.h
+++ b/libcxx/include/__math/remainder.h
@@ -14,7 +14,6 @@
 #include <__type_traits/is_arithmetic.h>
 #include <__type_traits/is_same.h>
 #include <__type_traits/promote.h>
-#include <limits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/find_index.h b/libcxx/include/__tuple/find_index.h
index 133b00419d0c6c..cc7329d3e89b4b 100644
--- a/libcxx/include/__tuple/find_index.h
+++ b/libcxx/include/__tuple/find_index.h
@@ -10,8 +10,8 @@
 #define _LIBCPP___TUPLE_FIND_INDEX_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__type_traits/is_same.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/make_tuple_types.h b/libcxx/include/__tuple/make_tuple_types.h
index 9e0fefae2f2f58..53e98c3d6e9757 100644
--- a/libcxx/include/__tuple/make_tuple_types.h
+++ b/libcxx/include/__tuple/make_tuple_types.h
@@ -10,6 +10,7 @@
 #define _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__fwd/array.h>
 #include <__fwd/tuple.h>
 #include <__tuple/tuple_element.h>
@@ -19,7 +20,6 @@
 #include <__type_traits/copy_cvref.h>
 #include <__type_traits/remove_cv.h>
 #include <__type_traits/remove_reference.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h
index c7145e0b011a99..a785cec138b2f8 100644
--- a/libcxx/include/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__tuple/sfinae_helpers.h
@@ -10,6 +10,7 @@
 #define _LIBCPP___TUPLE_SFINAE_HELPERS_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__fwd/tuple.h>
 #include <__tuple/make_tuple_types.h>
 #include <__tuple/tuple_element.h>
@@ -23,7 +24,6 @@
 #include <__type_traits/is_same.h>
 #include <__type_traits/remove_cvref.h>
 #include <__type_traits/remove_reference.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/tuple_element.h b/libcxx/include/__tuple/tuple_element.h
index 9127c47dc8f1a5..1404460e743529 100644
--- a/libcxx/include/__tuple/tuple_element.h
+++ b/libcxx/include/__tuple/tuple_element.h
@@ -10,9 +10,9 @@
 #define _LIBCPP___TUPLE_TUPLE_ELEMENT_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__tuple/tuple_indices.h>
 #include <__tuple/tuple_types.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/tuple_indices.h b/libcxx/include/__tuple/tuple_indices.h
index 501e711255ec10..25dc9ec6859161 100644
--- a/libcxx/include/__tuple/tuple_indices.h
+++ b/libcxx/include/__tuple/tuple_indices.h
@@ -10,8 +10,8 @@
 #define _LIBCPP___TUPLE_MAKE_TUPLE_INDICES_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__utility/integer_sequence.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/tuple_like_ext.h b/libcxx/include/__tuple/tuple_like_ext.h
index 0cc21e0b75fd1a..45c0e65d62ff3c 100644
--- a/libcxx/include/__tuple/tuple_like_ext.h
+++ b/libcxx/include/__tuple/tuple_like_ext.h
@@ -10,12 +10,12 @@
 #define _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__fwd/array.h>
 #include <__fwd/pair.h>
 #include <__fwd/tuple.h>
 #include <__tuple/tuple_types.h>
 #include <__type_traits/integral_constant.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/tuple_like_no_subrange.h b/libcxx/include/__tuple/tuple_like_no_subrange.h
index 274b0bf188e1f4..30018d6a05ae29 100644
--- a/libcxx/include/__tuple/tuple_like_no_subrange.h
+++ b/libcxx/include/__tuple/tuple_like_no_subrange.h
@@ -10,13 +10,13 @@
 #define _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__fwd/array.h>
 #include <__fwd/complex.h>
 #include <__fwd/pair.h>
 #include <__fwd/tuple.h>
 #include <__tuple/tuple_size.h>
 #include <__type_traits/remove_cvref.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/__tuple/tuple_size.h b/libcxx/include/__tuple/tuple_size.h
index 21c9811abeee7b..b970280fe37842 100644
--- a/libcxx/include/__tuple/tuple_size.h
+++ b/libcxx/include/__tuple/tuple_size.h
@@ -10,13 +10,13 @@
 #define _LIBCPP___TUPLE_TUPLE_SIZE_H
 
 #include <__config>
+#include <__cstddef/size_t.h>
 #include <__fwd/tuple.h>
 #include <__tuple/tuple_types.h>
 #include <__type_traits/enable_if.h>
 #include <__type_traits/integral_constant.h>
 #include <__type_traits/is_const.h>
 #include <__type_traits/is_volatile.h>
-#include <cstddef>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header

diff  --git a/libcxx/include/future b/libcxx/include/future
index 0be32620139e37..01c0b10172cd3b 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -369,6 +369,7 @@ template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
 #  include <__assert>
 #  include <__chrono/duration.h>
 #  include <__chrono/time_point.h>
+#  include <__condition_variable/condition_variable.h>
 #  include <__exception/exception_ptr.h>
 #  include <__memory/addressof.h>
 #  include <__memory/allocator.h>

diff  --git a/libcxx/include/variant b/libcxx/include/variant
index 5f2d03b7227b8c..1367cd66f3701c 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -233,7 +233,9 @@ namespace std {
 #include <__type_traits/conjunction.h>
 #include <__type_traits/dependent_type.h>
 #include <__type_traits/is_array.h>
+#include <__type_traits/is_assignable.h>
 #include <__type_traits/is_constructible.h>
+#include <__type_traits/is_convertible.h>
 #include <__type_traits/is_destructible.h>
 #include <__type_traits/is_nothrow_assignable.h>
 #include <__type_traits/is_nothrow_constructible.h>

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx11.csv b/libcxx/test/libcxx/transitive_includes/cxx11.csv
index f7b0179f6f60ed..722d624d3fb2ab 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx11.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx11.csv
@@ -354,11 +354,9 @@ future atomic
 future cerrno
 future chrono
 future cstddef
-future cstdint
 future cstdlib
-future cstring
+future ctime
 future exception
-future initializer_list
 future iosfwd
 future limits
 future mutex
@@ -369,7 +367,6 @@ future string
 future system_error
 future thread
 future type_traits
-future typeinfo
 future version
 initializer_list cstddef
 iomanip istream

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx14.csv b/libcxx/test/libcxx/transitive_includes/cxx14.csv
index 11afb76583a8cc..d82090f5506f20 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx14.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx14.csv
@@ -357,11 +357,9 @@ future atomic
 future cerrno
 future chrono
 future cstddef
-future cstdint
 future cstdlib
-future cstring
+future ctime
 future exception
-future initializer_list
 future iosfwd
 future limits
 future mutex
@@ -372,7 +370,6 @@ future string
 future system_error
 future thread
 future type_traits
-future typeinfo
 future version
 initializer_list cstddef
 iomanip istream

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx17.csv b/libcxx/test/libcxx/transitive_includes/cxx17.csv
index 42ba4ef3f6f527..f6e2243f9dfd75 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx17.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx17.csv
@@ -357,11 +357,9 @@ future atomic
 future cerrno
 future chrono
 future cstddef
-future cstdint
 future cstdlib
-future cstring
+future ctime
 future exception
-future initializer_list
 future iosfwd
 future limits
 future mutex
@@ -372,7 +370,6 @@ future string
 future system_error
 future thread
 future type_traits
-future typeinfo
 future version
 initializer_list cstddef
 iomanip istream

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx20.csv b/libcxx/test/libcxx/transitive_includes/cxx20.csv
index cd48b37520f157..2a0ec915657339 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx20.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx20.csv
@@ -364,11 +364,9 @@ functional version
 future atomic
 future cerrno
 future cstddef
-future cstdint
 future cstdlib
-future cstring
+future ctime
 future exception
-future initializer_list
 future iosfwd
 future limits
 future mutex
@@ -379,7 +377,6 @@ future string
 future system_error
 future thread
 future type_traits
-future typeinfo
 future version
 initializer_list cstddef
 iomanip istream

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx23.csv b/libcxx/test/libcxx/transitive_includes/cxx23.csv
index db09568fc76ffc..68877978d84ec0 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx23.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx23.csv
@@ -238,10 +238,8 @@ functional vector
 functional version
 future cerrno
 future cstddef
-future cstdint
 future cstdlib
-future cstring
-future initializer_list
+future ctime
 future limits
 future mutex
 future new

diff  --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index db09568fc76ffc..68877978d84ec0 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -238,10 +238,8 @@ functional vector
 functional version
 future cerrno
 future cstddef
-future cstdint
 future cstdlib
-future cstring
-future initializer_list
+future ctime
 future limits
 future mutex
 future new


        


More information about the libcxx-commits mailing list