Skip to content

Commit

Permalink
[libc++] Remove unused __functional includes
Browse files Browse the repository at this point in the history
Reviewed By: ldionne, #libc

Spies: arichardson, smeenai, libcxx-commits, arphaman

Differential Revision: https://reviews.llvm.org/D126098
  • Loading branch information
philnik777 committed May 28, 2022
1 parent fad6e37 commit 34f7380
Show file tree
Hide file tree
Showing 32 changed files with 31 additions and 43 deletions.
1 change: 1 addition & 0 deletions libcxx/include/__algorithm/sort.h
Expand Up @@ -16,6 +16,7 @@
#include <__algorithm/unwrap_iter.h>
#include <__bits>
#include <__config>
#include <__functional/operations.h>
#include <__utility/swap.h>
#include <climits>
#include <memory>
Expand Down
2 changes: 2 additions & 0 deletions libcxx/include/__format/format_arg.h
Expand Up @@ -16,7 +16,9 @@
#include <__format/format_error.h>
#include <__format/format_fwd.h>
#include <__format/format_parse_context.h>
#include <__functional/invoke.h>
#include <__memory/addressof.h>
#include <__utility/forward.h>
#include <__utility/unreachable.h>
#include <__variant/monostate.h>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/experimental/coroutine
Expand Up @@ -47,6 +47,7 @@ template <class P> struct hash<coroutine_handle<P>>;

#include <__assert> // all public C++ headers provide the assertion handler
#include <__functional/hash.h>
#include <__functional/operations.h>
#include <cstddef>
#include <experimental/__config>
#include <memory> // for hash<T*>
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/ext/hash_map
Expand Up @@ -206,6 +206,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__hash_table>
#include <algorithm>
#include <ext/__hash>
#include <functional>
#include <stdexcept>
#include <type_traits>

Expand Down
1 change: 1 addition & 0 deletions libcxx/include/ext/hash_set
Expand Up @@ -197,6 +197,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__hash_table>
#include <algorithm>
#include <ext/__hash>
#include <functional>

#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)
Expand Down
6 changes: 0 additions & 6 deletions libcxx/include/iterator
Expand Up @@ -724,12 +724,6 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
#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>
Expand Down
2 changes: 2 additions & 0 deletions libcxx/include/map
Expand Up @@ -532,7 +532,9 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <__algorithm/lexicographical_compare.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/binary_function.h>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__iterator/iterator_traits.h>
#include <__node_handle>
#include <__tree>
Expand Down
8 changes: 0 additions & 8 deletions libcxx/include/memory
Expand Up @@ -872,14 +872,6 @@ template<size_t N, class T>
#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/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
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/queue
Expand Up @@ -222,6 +222,7 @@ template <class T, class Container, class Compare>
#include <__algorithm/push_heap.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/operations.h>
#include <__iterator/iterator_traits.h>
#include <__memory/uses_allocator.h>
#include <__utility/forward.h>
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/set
Expand Up @@ -476,6 +476,7 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__iterator/iterator_traits.h>
#include <__node_handle>
#include <__tree>
Expand Down
7 changes: 1 addition & 6 deletions libcxx/include/string
Expand Up @@ -524,6 +524,7 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#include <__config>
#include <__debug>
#include <__format/enable_insertable.h>
#include <__functional/unary_function.h>
#include <__ios/fpos.h>
#include <__iterator/wrap_iter.h>
#include <__memory/allocate_at_least.h>
Expand All @@ -547,12 +548,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
#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>

Expand Down
1 change: 1 addition & 0 deletions libcxx/include/string_view
Expand Up @@ -199,6 +199,7 @@ namespace std {
#include <__algorithm/min.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/unary_function.h>
#include <__fwd/string_view.h>
#include <__ranges/concepts.h>
#include <__ranges/data.h>
Expand Down
6 changes: 0 additions & 6 deletions libcxx/include/tuple
Expand Up @@ -185,12 +185,6 @@ template <class... Types>
#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>
Expand Down
5 changes: 0 additions & 5 deletions libcxx/include/typeindex
Expand Up @@ -52,11 +52,6 @@ struct hash<type_index>
#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>
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/unordered_map
Expand Up @@ -519,6 +519,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__config>
#include <__debug>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__hash_table>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
Expand Down
1 change: 1 addition & 0 deletions libcxx/include/unordered_set
Expand Up @@ -464,6 +464,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__config>
#include <__debug>
#include <__functional/is_transparent.h>
#include <__functional/operations.h>
#include <__hash_table>
#include <__memory/addressof.h>
#include <__node_handle>
Expand Down
4 changes: 0 additions & 4 deletions libcxx/include/variant
Expand Up @@ -221,10 +221,6 @@ namespace std {
#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>
Expand Down
7 changes: 1 addition & 6 deletions libcxx/include/vector
Expand Up @@ -285,6 +285,7 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#include <__debug>
#include <__format/enable_insertable.h>
#include <__functional/hash.h>
#include <__functional/unary_function.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/wrap_iter.h>
#include <__memory/allocate_at_least.h>
Expand All @@ -305,12 +306,6 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
#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>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
3 changes: 2 additions & 1 deletion libcxx/test/libcxx/algorithms/debug_less.pass.cpp
Expand Up @@ -17,8 +17,9 @@
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1

#include <algorithm>
#include <iterator>
#include <cassert>
#include <functional>
#include <iterator>

#include "test_macros.h"
#include "check_assertion.h"
Expand Down
1 change: 1 addition & 0 deletions libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
Expand Up @@ -16,6 +16,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <iterator>
#include <vector>

Expand Down
Expand Up @@ -16,6 +16,7 @@

#include <algorithm>
#include <cassert>
#include <functional>

#include "test_macros.h"
#include "test_iterators.h"
Expand Down
Expand Up @@ -13,6 +13,7 @@

#include <chrono>
#include <concepts>
#include <functional>
#include <memory>
#include <random>
#include <type_traits>
Expand Down
Expand Up @@ -13,6 +13,7 @@

#include <chrono>
#include <concepts>
#include <functional>
#include <memory>
#include <random>
#include <type_traits>
Expand Down
Expand Up @@ -15,6 +15,7 @@
#include <iterator>
#include <cassert>
#include <cstddef>
#include <functional>

#include "test_macros.h"
#include "min_allocator.h"
Expand Down
Expand Up @@ -11,9 +11,10 @@
// template <class BinaryPredicate> void unique(BinaryPredicate binary_pred); // C++17 and before
// template <class BinaryPredicate> size_type unique(BinaryPredicate binary_pred); // C++20 and after

#include <cassert>
#include <forward_list>
#include <functional>
#include <iterator>
#include <cassert>

#include "test_macros.h"
#include "min_allocator.h"
Expand Down
Expand Up @@ -13,6 +13,7 @@

#include <list>
#include <cassert>
#include <functional>

#include "test_macros.h"
#include "min_allocator.h"
Expand Down
Expand Up @@ -23,6 +23,7 @@
#include <utility>
#include <cstdint>
#include <cassert>
#include <functional>

#include "test_macros.h"

Expand Down
Expand Up @@ -24,6 +24,7 @@
// using reference = iter_rvalue_reference_t<Iterator>; // Until C++20, value_type&&
// };

#include <functional>
#include <iterator>
#include <type_traits>

Expand Down
Expand Up @@ -16,6 +16,7 @@

#include <numeric>
#include <cassert>
#include <functional>

#include "test_macros.h"
#include "test_iterators.h"
Expand Down
Expand Up @@ -15,6 +15,7 @@

#include <cassert>
#include <concepts>
#include <functional>
#include <ranges>

#include "../types.h"
Expand Down
1 change: 1 addition & 0 deletions libcxx/test/std/ranges/range.adaptors/range.zip/types.h
Expand Up @@ -9,6 +9,7 @@
#ifndef TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ZIP_TYPES_H
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_ZIP_TYPES_H

#include <functional>
#include <ranges>

#include "test_macros.h"
Expand Down
1 change: 1 addition & 0 deletions libcxx/test/support/deduction_guides_sfinae_checks.h
Expand Up @@ -9,6 +9,7 @@
#ifndef TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H
#define TEST_SUPPORT_DEDUCTION_GUIDES_SFINAE_CHECKS_H

#include <functional>
#include <initializer_list>
#include <memory>
#include <type_traits>
Expand Down

0 comments on commit 34f7380

Please sign in to comment.