[libc++] Granularize algorithm includes
Reviewed By: Mordante, ldionne, Quuxplusone, #libc, #libc_abi Spies: #libc_vendors, libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D119667
This commit is contained in:
parent
125abb61f7
commit
2e2f3158c6
|
|
@ -52,6 +52,10 @@ API Changes
|
|||
``<filesystem>`` header. The associated macro
|
||||
``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has also been removed.
|
||||
|
||||
- Transitive includes of ``<algorithm>`` have been removed. If you see compiler errors
|
||||
related to missing declarations inside namespace ``std`` when updating libc++,
|
||||
you are probably missing ``#include <algorithm>`` in a file where you use algorithms.
|
||||
|
||||
ABI Changes
|
||||
-----------
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,13 @@
|
|||
#ifndef _LIBCPP___BIT_REFERENCE
|
||||
#define _LIBCPP___BIT_REFERENCE
|
||||
|
||||
#include <__algorithm/min.h>
|
||||
#include <__bits>
|
||||
#include <__config>
|
||||
#include <algorithm>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__memory/pointer_traits.h>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#ifndef _LIBCPP___FILESYSTEM_PATH_H
|
||||
#define _LIBCPP___FILESYSTEM_PATH_H
|
||||
|
||||
#include <__algorithm/replace.h>
|
||||
#include <__algorithm/replace_copy.h>
|
||||
#include <__availability>
|
||||
#include <__config>
|
||||
#include <__iterator/back_insert_iterator.h>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <__algorithm/copy.h>
|
||||
#include <__algorithm/fill_n.h>
|
||||
#include <__algorithm/transform.h>
|
||||
#include <__availability>
|
||||
#include <__config>
|
||||
#include <__format/format_error.h>
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@
|
|||
#ifndef _LIBCPP__HASH_TABLE
|
||||
#define _LIBCPP__HASH_TABLE
|
||||
|
||||
#include <__algorithm/max.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__bits> // __libcpp_clz
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <algorithm>
|
||||
#include <__functional/hash.h>
|
||||
#include <cmath>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,17 @@
|
|||
#ifndef _LIBCPP_SPLIT_BUFFER
|
||||
#define _LIBCPP_SPLIT_BUFFER
|
||||
|
||||
#include <__algorithm/max.h>
|
||||
#include <__algorithm/move.h>
|
||||
#include <__algorithm/move_backward.h>
|
||||
#include <__config>
|
||||
#include <__iterator/distance.h>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__iterator/move_iterator.h>
|
||||
#include <__memory/allocator.h>
|
||||
#include <__memory/compressed_pair.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
#ifndef _LIBCPP___TREE
|
||||
#define _LIBCPP___TREE
|
||||
|
||||
#include <__algorithm/min.h>
|
||||
#include <__config>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
|
|
|||
|
|
@ -108,11 +108,14 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/fill_n.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__algorithm/swap_ranges.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__tuple>
|
||||
#include <__utility/unreachable.h>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
|
|
|||
|
|
@ -112,8 +112,10 @@ template <size_t N> struct hash<std::bitset<N>>;
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/fill.h>
|
||||
#include <__bit_reference>
|
||||
#include <__config>
|
||||
#include <__functional/unary_function.h>
|
||||
#include <climits>
|
||||
#include <cstddef>
|
||||
#include <iosfwd>
|
||||
|
|
|
|||
|
|
@ -160,12 +160,20 @@ template <class T, class Allocator, class Predicate>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/copy.h>
|
||||
#include <__algorithm/copy_backward.h>
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/fill_n.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__algorithm/remove.h>
|
||||
#include <__algorithm/remove_if.h>
|
||||
#include <__algorithm/unwrap_iter.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__split_buffer>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <compare>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ inline namespace fundamentals_v1 {
|
|||
|
||||
#include <__debug>
|
||||
#include <__memory/uses_allocator.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <experimental/__config>
|
||||
#include <functional>
|
||||
|
|
|
|||
|
|
@ -649,7 +649,6 @@ public:
|
|||
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/is_permutation.h>
|
||||
#include <__config>
|
||||
#include <__hash_table>
|
||||
#include <ext/__hash>
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ template <class Value, class Hash, class Pred, class Alloc>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/is_permutation.h>
|
||||
#include <__config>
|
||||
#include <__hash_table>
|
||||
#include <ext/__hash>
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ namespace std {
|
|||
// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES.
|
||||
#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
|
||||
|
||||
#include <__algorithm/clamp.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__format/format_arg.h>
|
||||
|
|
|
|||
|
|
@ -179,9 +179,11 @@ template <class T, class Allocator, class Predicate>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/comp.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__config>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ typedef basic_fstream<wchar_t> wfstream;
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/max.h>
|
||||
#include <__availability>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
|
|
|
|||
|
|
@ -180,10 +180,13 @@ template <class T, class Allocator, class Predicate>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/comp.h>
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
|
|
|
|||
|
|
@ -187,10 +187,14 @@ template <class charT> class messages_byname;
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/find.h>
|
||||
#include <__algorithm/max.h>
|
||||
#include <__algorithm/reverse.h>
|
||||
#include <__algorithm/unwrap_iter.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__locale>
|
||||
#include <algorithm>
|
||||
#ifndef __APPLE__
|
||||
# include <cstdarg>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -528,6 +528,8 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__functional/is_transparent.h>
|
||||
|
|
|
|||
|
|
@ -217,11 +217,13 @@ template <class T, class Container, class Compare>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/make_heap.h>
|
||||
#include <__algorithm/pop_heap.h>
|
||||
#include <__algorithm/push_heap.h>
|
||||
#include <__config>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__memory/uses_allocator.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <compare>
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
|
|
|
|||
|
|
@ -1717,7 +1717,6 @@ class piecewise_linear_distribution
|
|||
#include <initializer_list>
|
||||
#include <version>
|
||||
|
||||
#include <algorithm> // for backward compatibility; TODO remove it
|
||||
#include <cmath> // for backward compatibility; TODO remove it
|
||||
#include <cstddef> // for backward compatibility; TODO remove it
|
||||
#include <cstdint> // for backward compatibility; TODO remove it
|
||||
|
|
|
|||
|
|
@ -762,6 +762,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
|
|||
} // std
|
||||
*/
|
||||
|
||||
#include <__algorithm/find.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__iterator/wrap_iter.h>
|
||||
|
|
|
|||
|
|
@ -471,6 +471,8 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__functional/is_transparent.h>
|
||||
|
|
|
|||
|
|
@ -518,11 +518,14 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/max.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__algorithm/remove.h>
|
||||
#include <__algorithm/remove_if.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__ios/fpos.h>
|
||||
#include <__iterator/wrap_iter.h>
|
||||
#include <algorithm>
|
||||
#include <compare>
|
||||
#include <cstdio> // EOF
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ namespace std {
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/min.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__ranges/concepts.h>
|
||||
|
|
@ -203,7 +204,6 @@ namespace std {
|
|||
#include <__ranges/enable_view.h>
|
||||
#include <__ranges/size.h>
|
||||
#include <__string>
|
||||
#include <algorithm>
|
||||
#include <compare>
|
||||
#include <iosfwd>
|
||||
#include <iterator>
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/is_permutation.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__functional/is_transparent.h>
|
||||
|
|
|
|||
|
|
@ -459,6 +459,7 @@ template <class Value, class Hash, class Pred, class Alloc>
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/is_permutation.h>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__functional/is_transparent.h>
|
||||
|
|
|
|||
|
|
@ -341,8 +341,14 @@ template <class T> unspecified2 end(const valarray<T>& v);
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/copy.h>
|
||||
#include <__algorithm/count.h>
|
||||
#include <__algorithm/fill.h>
|
||||
#include <__algorithm/max_element.h>
|
||||
#include <__algorithm/min.h>
|
||||
#include <__algorithm/min_element.h>
|
||||
#include <__algorithm/unwrap_iter.h>
|
||||
#include <__config>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
|
|
|||
|
|
@ -271,14 +271,22 @@ erase_if(vector<T, Allocator>& c, Predicate pred); // C++20
|
|||
|
||||
*/
|
||||
|
||||
#include <__algorithm/copy.h>
|
||||
#include <__algorithm/equal.h>
|
||||
#include <__algorithm/fill_n.h>
|
||||
#include <__algorithm/lexicographical_compare.h>
|
||||
#include <__algorithm/remove.h>
|
||||
#include <__algorithm/remove_if.h>
|
||||
#include <__algorithm/rotate.h>
|
||||
#include <__algorithm/unwrap_iter.h>
|
||||
#include <__bit_reference>
|
||||
#include <__config>
|
||||
#include <__debug>
|
||||
#include <__functional/hash.h>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__iterator/wrap_iter.h>
|
||||
#include <__split_buffer>
|
||||
#include <__utility/forward.h>
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
#include <compare>
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
// -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>;
|
||||
//
|
||||
|
||||
#include <algorithm>
|
||||
#include <forward_list>
|
||||
#include <iterator>
|
||||
#include <cassert>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
// void sort();
|
||||
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <format>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#define DEMANGLE_UTILITY_H
|
||||
|
||||
#include "StringView.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
// UNSUPPORTED: use_system_cxx_lib && target={{.+}}-apple-macosx11.0
|
||||
|
||||
#include "support/timer.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
Loading…
Reference in New Issue