Skip to content

Commit

Permalink
[libc++] Remove <string> and <vector> includes from <flat_map> (#114876)
Browse files Browse the repository at this point in the history
`<string>` doesn't seem to be required at all and `flat_map` doesn't
support `vector<bool>`, so we can include just `vector<T>`. This cuts
the include time in half on my system.
  • Loading branch information
philnik777 authored Nov 5, 2024
1 parent 3163f83 commit 332fda8
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 95 deletions.
11 changes: 9 additions & 2 deletions libcxx/include/__flat_map/flat_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define _LIBCPP___FLAT_MAP_FLAT_MAP_H

#include <__algorithm/lexicographical_compare_three_way.h>
#include <__algorithm/min.h>
#include <__algorithm/ranges_adjacent_find.h>
#include <__algorithm/ranges_equal.h>
#include <__algorithm/ranges_inplace_merge.h>
Expand All @@ -19,11 +20,14 @@
#include <__algorithm/ranges_stable_sort.h>
#include <__algorithm/ranges_unique.h>
#include <__algorithm/ranges_upper_bound.h>
#include <__algorithm/remove_if.h>
#include <__assert>
#include <__compare/synth_three_way.h>
#include <__concepts/convertible_to.h>
#include <__concepts/swappable.h>
#include <__config>
#include <__cstddef/byte.h>
#include <__cstddef/ptrdiff_t.h>
#include <__flat_map/sorted_unique.h>
#include <__functional/invoke.h>
#include <__functional/is_transparent.h>
Expand All @@ -34,13 +38,17 @@
#include <__iterator/next.h>
#include <__iterator/ranges_iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__memory/addressof.h>
#include <__memory/allocator_traits.h>
#include <__memory/uses_allocator.h>
#include <__memory/uses_allocator_construction.h>
#include <__ranges/access.h>
#include <__ranges/concepts.h>
#include <__ranges/container_compatible_range.h>
#include <__ranges/drop_view.h>
#include <__ranges/from_range.h>
#include <__ranges/ref_view.h>
#include <__ranges/size.h>
#include <__ranges/subrange.h>
#include <__ranges/zip_view.h>
#include <__type_traits/conjunction.h>
Expand All @@ -52,10 +60,9 @@
#include <__type_traits/maybe_const.h>
#include <__utility/exception_guard.h>
#include <__utility/pair.h>
#include <__vector/vector.h>
#include <initializer_list>
#include <stdexcept>
#include <string>
#include <vector>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
Expand Down
14 changes: 0 additions & 14 deletions libcxx/test/libcxx/transitive_includes/cxx03.csv
Original file line number Diff line number Diff line change
Expand Up @@ -683,18 +683,12 @@ filesystem typeinfo
filesystem utility
filesystem variant
filesystem version
flat_map algorithm
flat_map array
flat_map atomic
flat_map bit
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map cmath
flat_map compare
flat_map concepts
flat_map cstdarg
flat_map cstddef
flat_map cstdint
flat_map cstdio
Expand All @@ -705,27 +699,19 @@ flat_map cwchar
flat_map cwctype
flat_map exception
flat_map initializer_list
flat_map ios
flat_map iosfwd
flat_map iterator
flat_map limits
flat_map locale
flat_map memory
flat_map mutex
flat_map new
flat_map optional
flat_map ratio
flat_map stdexcept
flat_map streambuf
flat_map string
flat_map string_view
flat_map system_error
flat_map tuple
flat_map type_traits
flat_map typeinfo
flat_map utility
flat_map variant
flat_map vector
flat_map version
format algorithm
format array
Expand Down
14 changes: 0 additions & 14 deletions libcxx/test/libcxx/transitive_includes/cxx11.csv
Original file line number Diff line number Diff line change
Expand Up @@ -683,18 +683,12 @@ filesystem typeinfo
filesystem utility
filesystem variant
filesystem version
flat_map algorithm
flat_map array
flat_map atomic
flat_map bit
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map cmath
flat_map compare
flat_map concepts
flat_map cstdarg
flat_map cstddef
flat_map cstdint
flat_map cstdio
Expand All @@ -705,27 +699,19 @@ flat_map cwchar
flat_map cwctype
flat_map exception
flat_map initializer_list
flat_map ios
flat_map iosfwd
flat_map iterator
flat_map limits
flat_map locale
flat_map memory
flat_map mutex
flat_map new
flat_map optional
flat_map ratio
flat_map stdexcept
flat_map streambuf
flat_map string
flat_map string_view
flat_map system_error
flat_map tuple
flat_map type_traits
flat_map typeinfo
flat_map utility
flat_map variant
flat_map vector
flat_map version
format algorithm
format array
Expand Down
15 changes: 0 additions & 15 deletions libcxx/test/libcxx/transitive_includes/cxx14.csv
Original file line number Diff line number Diff line change
Expand Up @@ -701,18 +701,12 @@ filesystem typeinfo
filesystem utility
filesystem variant
filesystem version
flat_map algorithm
flat_map array
flat_map atomic
flat_map bit
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map cmath
flat_map compare
flat_map concepts
flat_map cstdarg
flat_map cstddef
flat_map cstdint
flat_map cstdio
Expand All @@ -722,29 +716,20 @@ flat_map ctime
flat_map cwchar
flat_map cwctype
flat_map exception
flat_map execution
flat_map initializer_list
flat_map ios
flat_map iosfwd
flat_map iterator
flat_map limits
flat_map locale
flat_map memory
flat_map mutex
flat_map new
flat_map optional
flat_map ratio
flat_map stdexcept
flat_map streambuf
flat_map string
flat_map string_view
flat_map system_error
flat_map tuple
flat_map type_traits
flat_map typeinfo
flat_map utility
flat_map variant
flat_map vector
flat_map version
format algorithm
format array
Expand Down
14 changes: 0 additions & 14 deletions libcxx/test/libcxx/transitive_includes/cxx17.csv
Original file line number Diff line number Diff line change
Expand Up @@ -707,18 +707,12 @@ filesystem utility
filesystem variant
filesystem vector
filesystem version
flat_map algorithm
flat_map array
flat_map atomic
flat_map bit
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map cmath
flat_map compare
flat_map concepts
flat_map cstdarg
flat_map cstddef
flat_map cstdint
flat_map cstdio
Expand All @@ -729,27 +723,19 @@ flat_map cwchar
flat_map cwctype
flat_map exception
flat_map initializer_list
flat_map ios
flat_map iosfwd
flat_map iterator
flat_map limits
flat_map locale
flat_map memory
flat_map mutex
flat_map new
flat_map optional
flat_map ratio
flat_map stdexcept
flat_map streambuf
flat_map string
flat_map string_view
flat_map system_error
flat_map tuple
flat_map type_traits
flat_map typeinfo
flat_map utility
flat_map variant
flat_map vector
flat_map version
format algorithm
format array
Expand Down
14 changes: 0 additions & 14 deletions libcxx/test/libcxx/transitive_includes/cxx20.csv
Original file line number Diff line number Diff line change
Expand Up @@ -703,18 +703,12 @@ filesystem utility
filesystem variant
filesystem vector
filesystem version
flat_map algorithm
flat_map array
flat_map atomic
flat_map bit
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map cmath
flat_map compare
flat_map concepts
flat_map cstdarg
flat_map cstddef
flat_map cstdint
flat_map cstdio
Expand All @@ -725,27 +719,19 @@ flat_map cwchar
flat_map cwctype
flat_map exception
flat_map initializer_list
flat_map ios
flat_map iosfwd
flat_map iterator
flat_map limits
flat_map locale
flat_map memory
flat_map mutex
flat_map new
flat_map optional
flat_map ratio
flat_map stdexcept
flat_map streambuf
flat_map string
flat_map string_view
flat_map system_error
flat_map tuple
flat_map type_traits
flat_map typeinfo
flat_map utility
flat_map variant
flat_map vector
flat_map version
format algorithm
format array
Expand Down
11 changes: 0 additions & 11 deletions libcxx/test/libcxx/transitive_includes/cxx23.csv
Original file line number Diff line number Diff line change
Expand Up @@ -361,30 +361,19 @@ filesystem string_view
filesystem tuple
filesystem typeinfo
filesystem version
flat_map array
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map compare
flat_map cstddef
flat_map cstdint
flat_map cstdio
flat_map cstdlib
flat_map cstring
flat_map cwchar
flat_map cwctype
flat_map initializer_list
flat_map iosfwd
flat_map limits
flat_map new
flat_map optional
flat_map stdexcept
flat_map string
flat_map string_view
flat_map tuple
flat_map typeinfo
flat_map vector
flat_map version
format array
format cctype
Expand Down
11 changes: 0 additions & 11 deletions libcxx/test/libcxx/transitive_includes/cxx26.csv
Original file line number Diff line number Diff line change
Expand Up @@ -361,30 +361,19 @@ filesystem string_view
filesystem tuple
filesystem typeinfo
filesystem version
flat_map array
flat_map cctype
flat_map cerrno
flat_map climits
flat_map clocale
flat_map compare
flat_map cstddef
flat_map cstdint
flat_map cstdio
flat_map cstdlib
flat_map cstring
flat_map cwchar
flat_map cwctype
flat_map initializer_list
flat_map iosfwd
flat_map limits
flat_map new
flat_map optional
flat_map stdexcept
flat_map string
flat_map string_view
flat_map tuple
flat_map typeinfo
flat_map vector
flat_map version
format array
format cctype
Expand Down

0 comments on commit 332fda8

Please sign in to comment.