[libcxx-commits] [libcxx] 4cd04d1 - [libc++] Removes unneeded <iterator> includes.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 15 09:14:12 PDT 2022


Author: Mark de Wever
Date: 2022-06-15T18:14:05+02:00
New Revision: 4cd04d1687f1096990119304a3eb22081ab4bb29

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

LOG: [libc++] Removes unneeded <iterator> includes.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D127675

Added: 
    

Modified: 
    libcxx/docs/ReleaseNotes.rst
    libcxx/include/algorithm
    libcxx/include/array
    libcxx/include/deque
    libcxx/include/ext/hash_map
    libcxx/include/ext/hash_set
    libcxx/include/format
    libcxx/include/forward_list
    libcxx/include/list
    libcxx/include/locale
    libcxx/include/map
    libcxx/include/memory
    libcxx/include/numeric
    libcxx/include/ostream
    libcxx/include/regex
    libcxx/include/set
    libcxx/include/span
    libcxx/include/string
    libcxx/include/string_view
    libcxx/include/unordered_map
    libcxx/include/unordered_set

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/ReleaseNotes.rst b/libcxx/docs/ReleaseNotes.rst
index bae9567893d25..d2084aeab7da4 100644
--- a/libcxx/docs/ReleaseNotes.rst
+++ b/libcxx/docs/ReleaseNotes.rst
@@ -99,6 +99,7 @@ API Changes
     - ``<chrono>``
     - ``<exception>``
     - ``<functional>``
+    - ``<iterator>``
     - ``<new>``
     - ``<typeinfo>``
     - ``<utility>``

diff  --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 0a9513ffb5580..8b82ea5b2e1a9 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -1068,7 +1068,6 @@ template <class BidirectionalIterator, class Compare>
 #include <cstddef>
 #include <cstring>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/array b/libcxx/include/array
index 4258853853429..a058f423174e5 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -120,7 +120,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
 #include <__utility/move.h>
 #include <__utility/unreachable.h>
 #include <compare>
-#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/deque b/libcxx/include/deque
index 559de77f070d0..e0a0ef00b1d92 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -182,7 +182,6 @@ template <class T, class Allocator, class Predicate>
 #include <__utility/swap.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <stdexcept>
 #include <type_traits>

diff  --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index eec8a8ad99928..92572c08c24cc 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -207,7 +207,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <algorithm>
 #include <ext/__hash>
 #include <functional>
-#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <type_traits>
 

diff  --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 4b68bec436808..eb61939406682 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -198,7 +198,6 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <algorithm>
 #include <ext/__hash>
 #include <functional>
-#include <iterator> // TODO: Remove this include
 
 #if defined(__DEPRECATED) && __DEPRECATED
 #if defined(_LIBCPP_WARNING)

diff  --git a/libcxx/include/format b/libcxx/include/format
index b60a6aaa68157..c88206666096a 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -157,6 +157,7 @@ namespace std {
 #include <__format/formatter_pointer.h>
 #include <__format/formatter_string.h>
 #include <__format/parser_std_format_spec.h>
+#include <__iterator/back_insert_iterator.h>
 #include <__iterator/incrementable_traits.h>
 #include <__variant/monostate.h>
 #include <array>

diff  --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 3dd0308c22c65..e34fa790ad9c5 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -190,7 +190,6 @@ template <class T, class Allocator, class Predicate>
 #include <__iterator/next.h>
 #include <__utility/forward.h>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <type_traits>

diff  --git a/libcxx/include/list b/libcxx/include/list
index 2ad428a23c1d5..9c646561f709e 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -198,7 +198,6 @@ template <class T, class Allocator, class Predicate>
 #include <__utility/move.h>
 #include <__utility/swap.h>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <type_traits>

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index 9d58be4724776..b95a64168777e 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -208,7 +208,6 @@ template <class charT> class messages_byname;
 #include <cstdlib>
 #include <ctime>
 #include <ios>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <streambuf>

diff  --git a/libcxx/include/map b/libcxx/include/map
index 33d83591ed824..36a99037b6f9e 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -544,7 +544,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__utility/swap.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <type_traits>
 #include <version>

diff  --git a/libcxx/include/memory b/libcxx/include/memory
index f69fc4d67dda6..d0bb99933d253 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -864,7 +864,6 @@ template<size_t N, class T>
 #include <cstdint>
 #include <cstring>
 #include <iosfwd>
-#include <iterator> // TODO: Remove this include
 #include <new>
 #include <stdexcept>
 #include <tuple>

diff  --git a/libcxx/include/numeric b/libcxx/include/numeric
index 4b142756e5df0..809838b210716 100644
--- a/libcxx/include/numeric
+++ b/libcxx/include/numeric
@@ -147,7 +147,6 @@ template<class T>
 #include <__assert> // all public C++ headers provide the assertion handler
 #include <__config>
 #include <cmath> // for isnormal
-#include <iterator> // TODO: Remove this include
 #include <version>
 
 #include <__numeric/accumulate.h>

diff  --git a/libcxx/include/ostream b/libcxx/include/ostream
index 9679e42b318d1..aa4c8c3d87929 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -138,7 +138,6 @@ template <class Stream, class T>
 #include <__config>
 #include <bitset>
 #include <ios>
-#include <iterator> // TODO: Remove this include
 #include <locale>
 #include <streambuf>
 #include <version>

diff  --git a/libcxx/include/regex b/libcxx/include/regex
index a6ad7d625a525..88acb5554e856 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -775,7 +775,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
 #include <compare>
 #include <deque>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <memory>
 #include <stdexcept>
 #include <string>

diff  --git a/libcxx/include/set b/libcxx/include/set
index fb29e4dbc4f8a..7cd4fe21ee0e5 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -485,7 +485,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred);  // C++20
 #include <__utility/forward.h>
 #include <compare>
 #include <initializer_list>
-#include <iterator> // TODO: Remove this include
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

diff  --git a/libcxx/include/span b/libcxx/include/span
index 023e62778414b..e60f22a1c8812 100644
--- a/libcxx/include/span
+++ b/libcxx/include/span
@@ -132,7 +132,9 @@ template<class R>
 #include <__debug>
 #include <__fwd/span.h>
 #include <__iterator/concepts.h>
+#include <__iterator/data.h>
 #include <__iterator/iterator_traits.h>
+#include <__iterator/size.h>
 #include <__iterator/wrap_iter.h>
 #include <__memory/pointer_traits.h>
 #include <__ranges/concepts.h>
@@ -143,7 +145,6 @@ template<class R>
 #include <__utility/forward.h>
 #include <array>        // for array
 #include <cstddef>      // for byte
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <type_traits>  // for remove_cv, etc
 #include <version>

diff  --git a/libcxx/include/string b/libcxx/include/string
index fa939af8123da..47cccc7320f3b 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -546,7 +546,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len );
 #include <cstring>
 #include <initializer_list>
 #include <iosfwd>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <memory>
 #include <stdexcept>

diff  --git a/libcxx/include/string_view b/libcxx/include/string_view
index 9e60bae22b06e..851cbf7765040 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -214,7 +214,6 @@ namespace std {
 #include <__string/char_traits.h>
 #include <compare>
 #include <iosfwd>
-#include <iterator> // TODO: Remove this include
 #include <limits>
 #include <stdexcept>
 #include <type_traits>

diff  --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 4fc068d6e696b..cf51ca0fdbf0b 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -528,7 +528,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
 #include <__node_handle>
 #include <__utility/forward.h>
 #include <compare>
-#include <iterator> // TODO: Remove this include
 #include <stdexcept>
 #include <tuple>
 #include <version>

diff  --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 48c6ff48df30f..d12185a9061f2 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -473,7 +473,6 @@ template <class Value, class Hash, class Pred, class Alloc>
 #include <__node_handle>
 #include <__utility/forward.h>
 #include <compare>
-#include <iterator> // TODO: Remove this include
 #include <version>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)


        


More information about the libcxx-commits mailing list