[llvm] 169a66e - [libc++] Remove __functional_base
Nikolas Klauser via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 11 10:16:10 PST 2022
Author: Nikolas Klauser
Date: 2022-02-11T19:16:01+01:00
New Revision: 169a66eac8f9aa0542d00a16896fba4e8e951e0f
URL: https://github.com/llvm/llvm-project/commit/169a66eac8f9aa0542d00a16896fba4e8e951e0f
DIFF: https://github.com/llvm/llvm-project/commit/169a66eac8f9aa0542d00a16896fba4e8e951e0f.diff
LOG: [libc++] Remove __functional_base
Reviewed By: ldionne, Quuxplusone, #libc
Spies: Mordante, mgorny, libcxx-commits, arichardson, llvm-commits, arphaman
Differential Revision: https://reviews.llvm.org/D119439
Added:
Modified:
libcxx/include/CMakeLists.txt
libcxx/include/__format/format_arg.h
libcxx/include/__memory/shared_ptr.h
libcxx/include/__memory/unique_ptr.h
libcxx/include/bitset
libcxx/include/experimental/__memory
libcxx/include/iterator
libcxx/include/memory
libcxx/include/optional
libcxx/include/string
libcxx/include/system_error
libcxx/include/thread
libcxx/include/tuple
libcxx/include/typeindex
libcxx/include/variant
libcxx/include/vector
libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
libcxx/utils/generate_private_header_tests.py
llvm/utils/gn/secondary/libcxx/include/BUILD.gn
Removed:
libcxx/include/__functional_base
################################################################################
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index f2a85c717f843..40ada5c9ce9ef 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -219,7 +219,6 @@ set(files
__functional/unary_negate.h
__functional/unwrap_ref.h
__functional/weak_result_type.h
- __functional_base
__hash_table
__ios/fpos.h
__iterator/access.h
diff --git a/libcxx/include/__format/format_arg.h b/libcxx/include/__format/format_arg.h
index fa8a41e1723d2..df08e93d2ee33 100644
--- a/libcxx/include/__format/format_arg.h
+++ b/libcxx/include/__format/format_arg.h
@@ -15,7 +15,6 @@
#include <__format/format_error.h>
#include <__format/format_fwd.h>
#include <__format/format_parse_context.h>
-#include <__functional_base>
#include <__memory/addressof.h>
#include <__variant/monostate.h>
#include <string>
diff --git a/libcxx/include/__functional_base b/libcxx/include/__functional_base
deleted file mode 100644
index caa3d7fd86ce0..0000000000000
--- a/libcxx/include/__functional_base
+++ /dev/null
@@ -1,32 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_FUNCTIONAL_BASE
-#define _LIBCPP_FUNCTIONAL_BASE
-
-#include <__config>
-#include <__functional/binary_function.h>
-#include <__functional/invoke.h>
-#include <__functional/operations.h>
-#include <__functional/reference_wrapper.h>
-#include <__functional/unary_function.h>
-#include <__functional/weak_result_type.h>
-#include <__memory/allocator_arg_t.h>
-#include <__memory/uses_allocator.h>
-#include <exception>
-#include <new>
-#include <type_traits>
-#include <typeinfo>
-#include <utility>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-#endif // _LIBCPP_FUNCTIONAL_BASE
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index a1a1b26be8299..0f28bcdfac11b 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -15,7 +15,6 @@
#include <__functional/binary_function.h>
#include <__functional/operations.h>
#include <__functional/reference_wrapper.h>
-#include <__functional_base>
#include <__memory/addressof.h>
#include <__memory/allocation_guard.h>
#include <__memory/allocator.h>
diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 94c1704ea5f1b..8b330508511af 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -13,7 +13,6 @@
#include <__config>
#include <__functional/hash.h>
#include <__functional/operations.h>
-#include <__functional_base>
#include <__memory/allocator_traits.h> // __pointer
#include <__memory/compressed_pair.h>
#include <__utility/forward.h>
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index cae001a60ec52..fa37e701345bd 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -114,7 +114,6 @@ template <size_t N> struct hash<std::bitset<N>>;
#include <__bit_reference>
#include <__config>
-#include <__functional_base>
#include <climits>
#include <cstddef>
#include <iosfwd>
diff --git a/libcxx/include/experimental/__memory b/libcxx/include/experimental/__memory
index 40021691d5ae2..749cf4c0c657f 100644
--- a/libcxx/include/experimental/__memory
+++ b/libcxx/include/experimental/__memory
@@ -10,7 +10,6 @@
#ifndef _LIBCPP_EXPERIMENTAL___MEMORY
#define _LIBCPP_EXPERIMENTAL___MEMORY
-#include <__functional_base>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
#include <experimental/__config>
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index da920f3d1c0e6..202667809dcaf 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -598,7 +598,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <__config>
#include <__debug>
-#include <__functional_base>
#include <__iterator/access.h>
#include <__iterator/advance.h>
#include <__iterator/back_insert_iterator.h>
@@ -643,6 +642,19 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
+#include <exception>
+#include <new>
+#include <typeinfo>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 0d3f5a5555738..3bc31d29ed6c5 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -805,7 +805,6 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
*/
#include <__config>
-#include <__functional_base>
#include <__memory/addressof.h>
#include <__memory/allocation_guard.h>
#include <__memory/allocator.h>
@@ -837,6 +836,14 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
# include <__memory/auto_ptr.h>
#endif
diff --git a/libcxx/include/optional b/libcxx/include/optional
index 236842d627d93..1599efdd32069 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -162,7 +162,6 @@ template<class T>
#include <__concepts/invocable.h>
#include <__config>
#include <__debug>
-#include <__functional_base>
#include <compare>
#include <functional>
#include <initializer_list>
@@ -172,6 +171,11 @@ template<class T>
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
+#include <typeinfo>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/string b/libcxx/include/string
index 4f3815f53e7b1..fa42edde0aa15 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -520,7 +520,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
#include <__config>
#include <__debug>
-#include <__functional_base>
#include <__ios/fpos.h>
#include <__iterator/wrap_iter.h>
#include <algorithm>
@@ -538,6 +537,16 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+#include <new>
+#include <typeinfo>
+
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
# include <cwchar>
#endif
diff --git a/libcxx/include/system_error b/libcxx/include/system_error
index 78dddc93059e8..66a3f3c1e0b7f 100644
--- a/libcxx/include/system_error
+++ b/libcxx/include/system_error
@@ -145,7 +145,6 @@ template <> struct hash<std::error_condition>;
#include <__config>
#include <__errc>
#include <__functional/unary_function.h>
-#include <__functional_base>
#include <compare>
#include <stdexcept>
#include <string>
diff --git a/libcxx/include/thread b/libcxx/include/thread
index 8af1e0f994735..5681f9d97386e 100644
--- a/libcxx/include/thread
+++ b/libcxx/include/thread
@@ -84,7 +84,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <__config>
#include <__debug>
-#include <__functional_base>
#include <__mutex_base>
#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 046a242befdc4..a28a2e81db3ec 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -169,7 +169,6 @@ template <class... Types>
#include <__compare/synth_three_way.h>
#include <__config>
#include <__functional/unwrap_ref.h>
-#include <__functional_base>
#include <__memory/allocator_arg_t.h>
#include <__memory/uses_allocator.h>
#include <__tuple>
@@ -182,6 +181,17 @@ template <class... Types>
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+#include <exception>
+#include <new>
+#include <typeinfo>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex
index c018b3c9f8749..b5dcd8496ae02 100644
--- a/libcxx/include/typeindex
+++ b/libcxx/include/typeindex
@@ -46,11 +46,21 @@ struct hash<type_index>
#include <__config>
#include <__functional/unary_function.h>
-#include <__functional_base>
#include <compare>
#include <typeinfo>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/weak_result_type.h>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
+#include <new>
+#include <utility>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 38daf672c41de..d102196f60a21 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -202,6 +202,8 @@ namespace std {
#include <__availability>
#include <__config>
#include <__functional/hash.h>
+#include <__functional/operations.h>
+#include <__functional/unary_function.h>
#include <__tuple>
#include <__utility/forward.h>
#include <__variant/monostate.h>
@@ -215,6 +217,15 @@ namespace std {
#include <utility>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/weak_result_type.h>
+#include <__memory/allocator_arg_t.h>
+#include <__memory/uses_allocator.h>
+#include <typeinfo>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/include/vector b/libcxx/include/vector
index f92caf941e8d8..43584e0675e35 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -274,7 +274,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <__bit_reference>
#include <__config>
#include <__debug>
-#include <__functional_base>
#include <__iterator/iterator_traits.h>
#include <__iterator/wrap_iter.h>
#include <__split_buffer>
@@ -292,6 +291,16 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <type_traits>
#include <version>
+// TODO: remove these headers
+#include <__functional/binary_function.h>
+#include <__functional/invoke.h>
+#include <__functional/operations.h>
+#include <__functional/reference_wrapper.h>
+#include <__functional/unary_function.h>
+#include <__functional/weak_result_type.h>
+#include <typeinfo>
+#include <utility>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
index 26d6bafbe5eed..4dcf5d18ebbc2 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/member_typedefs.compile.pass.cpp
@@ -12,8 +12,9 @@
// Test iterator category and iterator concepts.
-#include <ranges>
#include <cassert>
+#include <cstdint>
+#include <ranges>
#include "test_macros.h"
#include "../types.h"
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
index f4181801a948f..01c8539ec9047 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/minus.pass.cpp
@@ -15,8 +15,9 @@
// friend constexpr
diff erence_type operator-(const iterator& x, const iterator& y)
// requires advanceable<W>;
-#include <ranges>
#include <cassert>
+#include <cstdint>
+#include <ranges>
#include "test_macros.h"
#include "../types.h"
diff --git a/libcxx/utils/generate_private_header_tests.py b/libcxx/utils/generate_private_header_tests.py
index 81051a9f5ea78..e6eecd68ae506 100755
--- a/libcxx/utils/generate_private_header_tests.py
+++ b/libcxx/utils/generate_private_header_tests.py
@@ -53,7 +53,7 @@ def is_still_public(path):
rp = relative_path(path)
return not rp.startswith('__support') and rp not in [
"__bsd_locale_defaults.h", "__bsd_locale_fallbacks.h", "__config",
- "__config_site.in", "__debug", "__hash_table", "__functional_base",
+ "__config_site.in", "__debug", "__hash_table",
"__libcpp_version", "__threading_support", "__tree", "__undef_macros"
]
diff --git a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
index f06735b459331..164923f0014bf 100644
--- a/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/libcxx/include/BUILD.gn
@@ -274,7 +274,6 @@ if (current_toolchain == default_toolchain) {
"__functional/unary_negate.h",
"__functional/unwrap_ref.h",
"__functional/weak_result_type.h",
- "__functional_base",
"__hash_table",
"__ios/fpos.h",
"__iterator/access.h",
More information about the llvm-commits
mailing list