-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc++][C++03] Fix libc++ includes #109000
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
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
@llvm/pr-subscribers-libcxx Author: Nikolas Klauser (philnik777) ChangesPatch is 1.15 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109000.diff 1010 Files Affected:
diff --git a/libcxx/include/__cxx03/__algorithm/adjacent_find.h b/libcxx/include/__cxx03/__algorithm/adjacent_find.h
index 6f15456e3a4d07..88036db84de899 100644
--- a/libcxx/include/__cxx03/__algorithm/adjacent_find.h
+++ b/libcxx/include/__cxx03/__algorithm/adjacent_find.h
@@ -10,18 +10,18 @@
#ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H
#define _LIBCPP___ALGORITHM_ADJACENT_FIND_H
-#include <__algorithm/comp.h>
-#include <__algorithm/iterator_operations.h>
-#include <__config>
-#include <__iterator/iterator_traits.h>
-#include <__utility/move.h>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/all_of.h b/libcxx/include/__cxx03/__algorithm/all_of.h
index ec84eea7592966..b32d97241506e0 100644
--- a/libcxx/include/__cxx03/__algorithm/all_of.h
+++ b/libcxx/include/__cxx03/__algorithm/all_of.h
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___ALGORITHM_ALL_OF_H
#define _LIBCPP___ALGORITHM_ALL_OF_H
-#include <__config>
+#include <__cxx03/__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/any_of.h b/libcxx/include/__cxx03/__algorithm/any_of.h
index b5ff778c4171dc..bd7de96fbef40c 100644
--- a/libcxx/include/__cxx03/__algorithm/any_of.h
+++ b/libcxx/include/__cxx03/__algorithm/any_of.h
@@ -10,7 +10,7 @@
#ifndef _LIBCPP___ALGORITHM_ANY_OF_H
#define _LIBCPP___ALGORITHM_ANY_OF_H
-#include <__config>
+#include <__cxx03/__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/binary_search.h b/libcxx/include/__cxx03/__algorithm/binary_search.h
index 6065fc37274dce..a93c62b32d7428 100644
--- a/libcxx/include/__cxx03/__algorithm/binary_search.h
+++ b/libcxx/include/__cxx03/__algorithm/binary_search.h
@@ -9,11 +9,11 @@
#ifndef _LIBCPP___ALGORITHM_BINARY_SEARCH_H
#define _LIBCPP___ALGORITHM_BINARY_SEARCH_H
-#include <__algorithm/comp.h>
-#include <__algorithm/comp_ref_type.h>
-#include <__algorithm/lower_bound.h>
-#include <__config>
-#include <__iterator/iterator_traits.h>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__algorithm/comp_ref_type.h>
+#include <__cxx03/__algorithm/lower_bound.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/clamp.h b/libcxx/include/__cxx03/__algorithm/clamp.h
index 1a5a3d0744be9c..e5e4dbf774dc31 100644
--- a/libcxx/include/__cxx03/__algorithm/clamp.h
+++ b/libcxx/include/__cxx03/__algorithm/clamp.h
@@ -9,9 +9,9 @@
#ifndef _LIBCPP___ALGORITHM_CLAMP_H
#define _LIBCPP___ALGORITHM_CLAMP_H
-#include <__algorithm/comp.h>
-#include <__assert>
-#include <__config>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__assert>
+#include <__cxx03/__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/comp.h b/libcxx/include/__cxx03/__algorithm/comp.h
index a0fa88d6d2acd3..f01e395dc21ea5 100644
--- a/libcxx/include/__cxx03/__algorithm/comp.h
+++ b/libcxx/include/__cxx03/__algorithm/comp.h
@@ -9,8 +9,8 @@
#ifndef _LIBCPP___ALGORITHM_COMP_H
#define _LIBCPP___ALGORITHM_COMP_H
-#include <__config>
-#include <__type_traits/desugars_to.h>
+#include <__cxx03/__config>
+#include <__cxx03/__type_traits/desugars_to.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/comp_ref_type.h b/libcxx/include/__cxx03/__algorithm/comp_ref_type.h
index c367fbb91ac282..413bf30c6a64ce 100644
--- a/libcxx/include/__cxx03/__algorithm/comp_ref_type.h
+++ b/libcxx/include/__cxx03/__algorithm/comp_ref_type.h
@@ -9,9 +9,9 @@
#ifndef _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
#define _LIBCPP___ALGORITHM_COMP_REF_TYPE_H
-#include <__assert>
-#include <__config>
-#include <__utility/declval.h>
+#include <__cxx03/__assert>
+#include <__cxx03/__config>
+#include <__cxx03/__utility/declval.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/copy.h b/libcxx/include/__cxx03/__algorithm/copy.h
index 0890b895f54092..6de8df3f980fea 100644
--- a/libcxx/include/__cxx03/__algorithm/copy.h
+++ b/libcxx/include/__cxx03/__algorithm/copy.h
@@ -9,22 +9,22 @@
#ifndef _LIBCPP___ALGORITHM_COPY_H
#define _LIBCPP___ALGORITHM_COPY_H
-#include <__algorithm/copy_move_common.h>
-#include <__algorithm/for_each_segment.h>
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/min.h>
-#include <__config>
-#include <__iterator/segmented_iterator.h>
-#include <__type_traits/common_type.h>
-#include <__utility/move.h>
-#include <__utility/pair.h>
+#include <__cxx03/__algorithm/copy_move_common.h>
+#include <__cxx03/__algorithm/for_each_segment.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/min.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/segmented_iterator.h>
+#include <__cxx03/__type_traits/common_type.h>
+#include <__cxx03/__utility/move.h>
+#include <__cxx03/__utility/pair.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/copy_backward.h b/libcxx/include/__cxx03/__algorithm/copy_backward.h
index 73dc846a975a44..dd7ff8ada5280c 100644
--- a/libcxx/include/__cxx03/__algorithm/copy_backward.h
+++ b/libcxx/include/__cxx03/__algorithm/copy_backward.h
@@ -9,22 +9,22 @@
#ifndef _LIBCPP___ALGORITHM_COPY_BACKWARD_H
#define _LIBCPP___ALGORITHM_COPY_BACKWARD_H
-#include <__algorithm/copy_move_common.h>
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/min.h>
-#include <__config>
-#include <__iterator/segmented_iterator.h>
-#include <__type_traits/common_type.h>
-#include <__type_traits/is_constructible.h>
-#include <__utility/move.h>
-#include <__utility/pair.h>
+#include <__cxx03/__algorithm/copy_move_common.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/min.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/segmented_iterator.h>
+#include <__cxx03/__type_traits/common_type.h>
+#include <__cxx03/__type_traits/is_constructible.h>
+#include <__cxx03/__utility/move.h>
+#include <__cxx03/__utility/pair.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/copy_if.h b/libcxx/include/__cxx03/__algorithm/copy_if.h
index 228e4d22323e3c..345b12878d3333 100644
--- a/libcxx/include/__cxx03/__algorithm/copy_if.h
+++ b/libcxx/include/__cxx03/__algorithm/copy_if.h
@@ -9,7 +9,7 @@
#ifndef _LIBCPP___ALGORITHM_COPY_IF_H
#define _LIBCPP___ALGORITHM_COPY_IF_H
-#include <__config>
+#include <__cxx03/__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/copy_move_common.h b/libcxx/include/__cxx03/__algorithm/copy_move_common.h
index 8a98451a8f9653..c5983070251764 100644
--- a/libcxx/include/__cxx03/__algorithm/copy_move_common.h
+++ b/libcxx/include/__cxx03/__algorithm/copy_move_common.h
@@ -9,29 +9,29 @@
#ifndef _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H
#define _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/unwrap_iter.h>
-#include <__algorithm/unwrap_range.h>
-#include <__config>
-#include <__iterator/iterator_traits.h>
-#include <__memory/pointer_traits.h>
-#include <__string/constexpr_c_functions.h>
-#include <__type_traits/enable_if.h>
-#include <__type_traits/is_always_bitcastable.h>
-#include <__type_traits/is_constant_evaluated.h>
-#include <__type_traits/is_constructible.h>
-#include <__type_traits/is_trivially_assignable.h>
-#include <__type_traits/is_volatile.h>
-#include <__utility/move.h>
-#include <__utility/pair.h>
-#include <cstddef>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/unwrap_iter.h>
+#include <__cxx03/__algorithm/unwrap_range.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__memory/pointer_traits.h>
+#include <__cxx03/__string/constexpr_c_functions.h>
+#include <__cxx03/__type_traits/enable_if.h>
+#include <__cxx03/__type_traits/is_always_bitcastable.h>
+#include <__cxx03/__type_traits/is_constant_evaluated.h>
+#include <__cxx03/__type_traits/is_constructible.h>
+#include <__cxx03/__type_traits/is_trivially_assignable.h>
+#include <__cxx03/__type_traits/is_volatile.h>
+#include <__cxx03/__utility/move.h>
+#include <__cxx03/__utility/pair.h>
+#include <__cxx03/cstddef>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/copy_n.h b/libcxx/include/__cxx03/__algorithm/copy_n.h
index f93f39203a7e3b..14f14029443359 100644
--- a/libcxx/include/__cxx03/__algorithm/copy_n.h
+++ b/libcxx/include/__cxx03/__algorithm/copy_n.h
@@ -9,11 +9,11 @@
#ifndef _LIBCPP___ALGORITHM_COPY_N_H
#define _LIBCPP___ALGORITHM_COPY_N_H
-#include <__algorithm/copy.h>
-#include <__config>
-#include <__iterator/iterator_traits.h>
-#include <__type_traits/enable_if.h>
-#include <__utility/convert_to_integral.h>
+#include <__cxx03/__algorithm/copy.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__type_traits/enable_if.h>
+#include <__cxx03/__utility/convert_to_integral.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/count.h b/libcxx/include/__cxx03/__algorithm/count.h
index 1cfe7f631ac1b7..b7024dc8c63180 100644
--- a/libcxx/include/__cxx03/__algorithm/count.h
+++ b/libcxx/include/__cxx03/__algorithm/count.h
@@ -10,22 +10,22 @@
#ifndef _LIBCPP___ALGORITHM_COUNT_H
#define _LIBCPP___ALGORITHM_COUNT_H
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/min.h>
-#include <__bit/invert_if.h>
-#include <__bit/popcount.h>
-#include <__config>
-#include <__functional/identity.h>
-#include <__functional/invoke.h>
-#include <__fwd/bit_reference.h>
-#include <__iterator/iterator_traits.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/min.h>
+#include <__cxx03/__bit/invert_if.h>
+#include <__cxx03/__bit/popcount.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/identity.h>
+#include <__cxx03/__functional/invoke.h>
+#include <__cxx03/__fwd/bit_reference.h>
+#include <__cxx03/__iterator/iterator_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/count_if.h b/libcxx/include/__cxx03/__algorithm/count_if.h
index 25782069d03275..eeb42052b08ae1 100644
--- a/libcxx/include/__cxx03/__algorithm/count_if.h
+++ b/libcxx/include/__cxx03/__algorithm/count_if.h
@@ -10,8 +10,8 @@
#ifndef _LIBCPP___ALGORITHM_COUNT_IF_H
#define _LIBCPP___ALGORITHM_COUNT_IF_H
-#include <__config>
-#include <__iterator/iterator_traits.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/equal.h b/libcxx/include/__cxx03/__algorithm/equal.h
index bfc8f72f6eb195..a4d0a999b18192 100644
--- a/libcxx/include/__cxx03/__algorithm/equal.h
+++ b/libcxx/include/__cxx03/__algorithm/equal.h
@@ -10,27 +10,27 @@
#ifndef _LIBCPP___ALGORITHM_EQUAL_H
#define _LIBCPP___ALGORITHM_EQUAL_H
-#include <__algorithm/comp.h>
-#include <__algorithm/unwrap_iter.h>
-#include <__config>
-#include <__functional/identity.h>
-#include <__functional/invoke.h>
-#include <__iterator/distance.h>
-#include <__iterator/iterator_traits.h>
-#include <__string/constexpr_c_functions.h>
-#include <__type_traits/desugars_to.h>
-#include <__type_traits/enable_if.h>
-#include <__type_traits/is_constant_evaluated.h>
-#include <__type_traits/is_equality_comparable.h>
-#include <__type_traits/is_volatile.h>
-#include <__utility/move.h>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__algorithm/unwrap_iter.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/identity.h>
+#include <__cxx03/__functional/invoke.h>
+#include <__cxx03/__iterator/distance.h>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__string/constexpr_c_functions.h>
+#include <__cxx03/__type_traits/desugars_to.h>
+#include <__cxx03/__type_traits/enable_if.h>
+#include <__cxx03/__type_traits/is_constant_evaluated.h>
+#include <__cxx03/__type_traits/is_equality_comparable.h>
+#include <__cxx03/__type_traits/is_volatile.h>
+#include <__cxx03/__utility/move.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/equal_range.h b/libcxx/include/__cxx03/__algorithm/equal_range.h
index 09bbf8f006021a..9abda2bd2e36f9 100644
--- a/libcxx/include/__cxx03/__algorithm/equal_range.h
+++ b/libcxx/include/__cxx03/__algorithm/equal_range.h
@@ -9,30 +9,30 @@
#ifndef _LIBCPP___ALGORITHM_EQUAL_RANGE_H
#define _LIBCPP___ALGORITHM_EQUAL_RANGE_H
-#include <__algorithm/comp.h>
-#include <__algorithm/comp_ref_type.h>
-#include <__algorithm/half_positive.h>
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/lower_bound.h>
-#include <__algorithm/upper_bound.h>
-#include <__config>
-#include <__functional/identity.h>
-#include <__functional/invoke.h>
-#include <__iterator/advance.h>
-#include <__iterator/distance.h>
-#include <__iterator/iterator_traits.h>
-#include <__iterator/next.h>
-#include <__type_traits/is_callable.h>
-#include <__type_traits/is_constructible.h>
-#include <__utility/move.h>
-#include <__utility/pair.h>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__algorithm/comp_ref_type.h>
+#include <__cxx03/__algorithm/half_positive.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/lower_bound.h>
+#include <__cxx03/__algorithm/upper_bound.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/identity.h>
+#include <__cxx03/__functional/invoke.h>
+#include <__cxx03/__iterator/advance.h>
+#include <__cxx03/__iterator/distance.h>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__iterator/next.h>
+#include <__cxx03/__type_traits/is_callable.h>
+#include <__cxx03/__type_traits/is_constructible.h>
+#include <__cxx03/__utility/move.h>
+#include <__cxx03/__utility/pair.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/fill.h b/libcxx/include/__cxx03/__algorithm/fill.h
index 1ce3eadb013d05..5da0f4457daa69 100644
--- a/libcxx/include/__cxx03/__algorithm/fill.h
+++ b/libcxx/include/__cxx03/__algorithm/fill.h
@@ -9,9 +9,9 @@
#ifndef _LIBCPP___ALGORITHM_FILL_H
#define _LIBCPP___ALGORITHM_FILL_H
-#include <__algorithm/fill_n.h>
-#include <__config>
-#include <__iterator/iterator_traits.h>
+#include <__cxx03/__algorithm/fill_n.h>
+#include <__cxx03/__config>
+#include <__cxx03/__iterator/iterator_traits.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__cxx03/__algorithm/fill_n.h b/libcxx/include/__cxx03/__algorithm/fill_n.h
index f29633f88087f0..fd548f27056a17 100644
--- a/libcxx/include/__cxx03/__algorithm/fill_n.h
+++ b/libcxx/include/__cxx03/__algorithm/fill_n.h
@@ -9,19 +9,19 @@
#ifndef _LIBCPP___ALGORITHM_FILL_N_H
#define _LIBCPP___ALGORITHM_FILL_N_H
-#include <__algorithm/min.h>
-#include <__config>
-#include <__fwd/bit_reference.h>
-#include <__iterator/iterator_traits.h>
-#include <__memory/pointer_traits.h>
-#include <__utility/convert_to_integral.h>
+#include <__cxx03/__algorithm/min.h>
+#include <__cxx03/__config>
+#include <__cxx03/__fwd/bit_reference.h>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__memory/pointer_traits.h>
+#include <__cxx03/__utility/convert_to_integral.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/find.h b/libcxx/include/__cxx03/__algorithm/find.h
index 7f58dbb13a5776..7a48a449c897bb 100644
--- a/libcxx/include/__cxx03/__algorithm/find.h
+++ b/libcxx/include/__cxx03/__algorithm/find.h
@@ -10,25 +10,25 @@
#ifndef _LIBCPP___ALGORITHM_FIND_H
#define _LIBCPP___ALGORITHM_FIND_H
-#include <__algorithm/find_segment_if.h>
-#include <__algorithm/min.h>
-#include <__algorithm/unwrap_iter.h>
-#include <__bit/countr.h>
-#include <__bit/invert_if.h>
-#include <__config>
-#include <__functional/identity.h>
-#include <__functional/invoke.h>
-#include <__fwd/bit_reference.h>
-#include <__iterator/segmented_iterator.h>
-#include <__string/constexpr_c_functions.h>
-#include <__type_traits/is_integral.h>
-#include <__type_traits/is_same.h>
-#include <__type_traits/is_signed.h>
-#include <__utility/move.h>
-#include <limits>
+#include <__cxx03/__algorithm/find_segment_if.h>
+#include <__cxx03/__algorithm/min.h>
+#include <__cxx03/__algorithm/unwrap_iter.h>
+#include <__cxx03/__bit/countr.h>
+#include <__cxx03/__bit/invert_if.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/identity.h>
+#include <__cxx03/__functional/invoke.h>
+#include <__cxx03/__fwd/bit_reference.h>
+#include <__cxx03/__iterator/segmented_iterator.h>
+#include <__cxx03/__string/constexpr_c_functions.h>
+#include <__cxx03/__type_traits/is_integral.h>
+#include <__cxx03/__type_traits/is_same.h>
+#include <__cxx03/__type_traits/is_signed.h>
+#include <__cxx03/__utility/move.h>
+#include <__cxx03/limits>
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
-# include <cwchar>
+# include <__cxx03/cwchar>
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -36,7 +36,7 @@
#endif
_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__cxx03/__undef_macros>
_LIBCPP_BEGIN_NAMESPACE_STD
diff --git a/libcxx/include/__cxx03/__algorithm/find_end.h b/libcxx/include/__cxx03/__algorithm/find_end.h
index 7e08e7953534eb..34a45e2c66fae9 100644
--- a/libcxx/include/__cxx03/__algorithm/find_end.h
+++ b/libcxx/include/__cxx03/__algorithm/find_end.h
@@ -10,17 +10,17 @@
#ifndef _LIBCPP___ALGORITHM_FIND_END_OF_H
#define _LIBCPP___ALGORITHM_FIND_END_OF_H
-#include <__algorithm/comp.h>
-#include <__algorithm/iterator_operations.h>
-#include <__algorithm/search.h>
-#include <__config>
-#include <__functional/identity.h>
-#include <__functional/invoke.h>
-#include <__iterator/advance.h>
-#include <__iterator/iterator_traits.h>
-#include <__iterator/next.h>
-#include <__iterator/reverse_iterator.h>
-#include <__utility/pair.h>
+#include <__cxx03/__algorithm/comp.h>
+#include <__cxx03/__algorithm/iterator_operations.h>
+#include <__cxx03/__algorithm/search.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/identity.h>
+#include <__cxx03/__functional/invoke.h>
+#include <__cxx03/__iterator/advance.h>
+#include <__cxx03/__iterator/iterator_traits.h>
+#include <__cxx03/__iterator/next.h>
+#include <__cxx03/__iterator/reverse_iter...
[truncated]
|
a5c77e5
to
d5ea6d6
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.
I wouldn't be surprised if we later discover that a few headers need to be handled specially, but as a mechanical step this LGTM.
#include <stdlib.h> | ||
#include <__cxx03/__locale_dir/locale_base_api/locale_guard.h> | ||
#include <__cxx03/cstdio> | ||
#include <__cxx03/stdarg.h> |
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.
For example, we don't provide stdarg.h
in libc++, so this part of the change is technically incorrect. However, I think it makes sense to proceed with this mechanical rewrite and then gradually narrow down the number of issues when we get an actual CI configuration for this.
This is part of the "Freezing C++03 headers" proposal explained in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319/58. This patch updates the include paths used in `__cxx03/` to refer to the `__cxx03/` headers.
This is part of the "Freezing C++03 headers" proposal explained in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319/58. This patch updates the include paths used in `__cxx03/` to refer to the `__cxx03/` headers.
This updates libcxx and libcxxabi to LLVM 20.1.4: https://github.com/llvm/llvm-project/releases/tag/llvmorg-20.1.4 Before going into each additional change of the PR, these are some noteworthy changes from this LLVM release: - Freezing C++03 headers - RFC: https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319 - PRs: - llvm/llvm-project#108999 - llvm/llvm-project#109000 - llvm/llvm-project#109001 - llvm/llvm-project#109002 - This copies libc++ headers of the last LLVM 19 release into a separate directory (https://github.com/llvm/llvm-project/tree/main/libcxx/include/__cxx03) and redirects all C++03 workflow there. The motivation is not to fix C++03 related changes unless they are critical bugs, and simplifies the main headers. So the main headers are like ``` #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) # include <__cxx03/algorithm> #else ... main header content ... ``` As you can see it looks like we can avoid opting into this by not defining `_LIBCPP_USE_FROZEN_CXX03_HEADERS` at the moment. I think their eventual goal is to remove C++03 support from the main headers but it hasn't seem to have happened yet and I don't know what their timeline for that is. Adding that `__cxx03` directory increases the header size by 10MB. We can get away not using them by not defining `_LIBCPP_USE_FROZEN_CXX03_HEADERS` in this release, so this update does not include that directory. - Sharing of headers between libc++ and libc (Project Hand in Hand) - RFC: https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701 - PR: llvm/llvm-project#91651 (More are likely to come) This tries to share some libc headers from libcxx. libcxx's source files can depend on headers from `libc/shared`, `libc/src/__support`, `libc/include/llvm-libc-macros`, and `libc/include/llvm-libc-types`. And it turns out libcxx can also depend on `libc/hdr`, even though the directory is not in the diagram in the RFC. These headers can be only included from `libcxx/src` and not `libcxx/include`, to prevent libcxx's API from changing. So these headers don't need to be copied into `cache/`. - Locale API reimplementation It doesn't seem to have an RFC, but the PRs are: - llvm/llvm-project#113737 - llvm/llvm-project#115176 - llvm/llvm-project#115752 - llvm/llvm-project#122489 It looks this aims provide a new way to define locale API for each platform. Currently Apple, FreeBSD, MSVCRT, and Fuschia are using the new API and the others are still using the old one: https://github.com/llvm/llvm-project/blob/ec28b8f9cc7f2ac187d8a617a6d08d5e56f9120e/libcxx/include/__locale_dir/locale_base_api.h#L116-L138 For our purpose, adding `if defined(__EMSCRIPTEN__)` entry to the list of "old" list seems to work for the moment, but we may need to move to the new way eventually later. --- Additional changes: - Copy `vendor/llvm/default_assertion_handler.in` to `__assertion_handler`: aa53648 Our previous `__assertion_handler` was copied from `libcxx/vendor/llvm/default_assertion_handler.in`. This updates our `__assertion_handler` to the new `libcxx/vendor/llvm/default_assertion_handler.in`. For what this file is, see the PR description of #22994, with which the file was added. - Remove `libcxx/include/__cxx03` directory: d646f6b As I described in "Freezing C++ headers" above, C++03 headers were copied to `include/cxx03` to be "frozen". But by not defining `_LIBCPP_USE_FROZEN_CXX03_HEADERS` we can still use the main headers. This new `__cxx03` header directory is almost 10M and we are not using it in this update, this deletes it. - Define more variables in `__config_site`: 9912236 libcxx decides to almost all configuration macros to be defined. So before it tested whether a macro was defined/undefined, and now it assumes it is defined and tests whether its value is 1/0. Before llvm/llvm-project#112094 `_config_site.in` used to use `#cmakedefine`, which only defined variables when they were enabled, but now it uses `#cmakedefine01`, which always defines variables and assigns 1 or 0 depending on whether the feature is enabled. So this change adds `#define` to each variable that `_config_site.in` has an entry of. The value assigned is 1 if it was defined in our previous Emscripten environment and 0 if not. - Fix Emscripten's locale: 2ae01b0 Before, the code was like https://github.com/emscripten-core/emscripten/blob/dc1abd514b1bade135a01a4453a9ff6def0793b6/system/lib/libcxx/include/__locale_dir/locale_base_api.h#L12-L30 But now they are divided into two parts, one using the new API and the other using old. See "Locale API reimplementation" above. https://github.com/llvm/llvm-project/blob/ec28b8f9cc7f2ac187d8a617a6d08d5e56f9120e/libcxx/include/__locale_dir/locale_base_api.h#L116-L138 This adds Emscripten in the beginning of the "old" API list. (This has to be the beginning; see #23414) - Import libc headers used by libcxx: 12a4ee4, 12a4ee4 and 43c8ce4 This imports a part of libc headers into `system/lib/llvm-libc`. The imported directories are: - `libc/shared` - `libc/src/__support` - `libc/include/llvm-libc-macros` - `libc/include/llvm-libc-types` - `libc/hdr` See "sharing of headers between libc+ and libc" above for details. This also applies llvm/llvm-project#133999, which is a bugfix that has not be backported, which fixes the bug of including from a wrong directory. - `std::uncaught_exception` -> `std::uncaught_exceptions`: 1bf4e78 `std::uncaught_exception` has been deprecated in C++17, so it generates a warning (which we treat as an error). Replaced it with `std::uncaught_exceptions`, which returns the number of uncaught exceptions (but can still be used as a boolean in the test). - Remove `ryu_constants.h` and `ryu_long_double_constants.h` from libc: 5767ac4 These are not used from libcxx and `ryu_long_double_constants.h` is huge (12M).
This is part of the "Freezing C++03 headers" proposal explained in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319/58.
This patch updates the include paths used in
__cxx03/
to refer to the__cxx03/
headers.