[libcxx-commits] [libcxx] 6cb05ca - [libcxx][modularisation] adds several headers to the module map

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 16 09:08:11 PDT 2021


Author: Christopher Di Bella
Date: 2021-07-16T16:06:54Z
New Revision: 6cb05ca392fb46c3c2ad1f3624dad3b55adc5cf1

URL: https://github.com/llvm/llvm-project/commit/6cb05ca392fb46c3c2ad1f3624dad3b55adc5cf1
DIFF: https://github.com/llvm/llvm-project/commit/6cb05ca392fb46c3c2ad1f3624dad3b55adc5cf1.diff

LOG: [libcxx][modularisation] adds several headers to the module map

* <__algorithm/iter_swap.h>
* <__algorithm/swap_ranges.h>
* <__functional/is_transparent.h>
* <__memory/uses_allocator.h>
* <__ranges/drop_view.h>
* <__ranges/transform_view.h>
* <shared_mutex>
* <span>

Also updates header inclusions that were affected.

**NOTE:** This is a proper subset of D105932. Since the content has
already been LGTM'd, I intend to merge this patch without review,
pending green CI. I decided it would be better to move these changes
into their own commit since the former patch has undergone further
changes and will need yet another light review. In the event any of
that gets rolled back (for whatever reason), the changes in this patch
won't be affected.

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

Added: 
    

Modified: 
    libcxx/include/__ranges/drop_view.h
    libcxx/include/__ranges/transform_view.h
    libcxx/include/module.modulemap
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
    libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
    libcxx/test/std/containers/views/span.sub/first.fail.cpp
    libcxx/test/std/containers/views/span.sub/last.fail.cpp
    libcxx/test/std/containers/views/span.sub/subspan.fail.cpp
    libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
    libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h
index fe5b80330e25b..7ba74e54f6a80 100644
--- a/libcxx/include/__ranges/drop_view.h
+++ b/libcxx/include/__ranges/drop_view.h
@@ -15,6 +15,9 @@
 #include <__iterator/next.h>
 #include <__ranges/access.h>
 #include <__ranges/all.h>
+#include <__ranges/concepts.h>
+#include <__ranges/enable_borrowed_range.h>
+#include <__ranges/size.h>
 #include <__ranges/view_interface.h>
 #include <optional>
 #include <type_traits>

diff  --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h
index b86cdd3e94d40..2d6f62deebc47 100644
--- a/libcxx/include/__ranges/transform_view.h
+++ b/libcxx/include/__ranges/transform_view.h
@@ -18,7 +18,9 @@
 #include <__ranges/concepts.h>
 #include <__ranges/copyable_box.h>
 #include <__ranges/empty.h>
+#include <__ranges/size.h>
 #include <__ranges/view_interface.h>
+#include <concepts>
 #include <type_traits>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

diff  --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index c2e6564bb1247..07665937de1b5 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -254,6 +254,7 @@ module std [system] {
       module is_permutation           { header "__algorithm/is_permutation.h" }
       module is_sorted                { header "__algorithm/is_sorted.h" }
       module is_sorted_until          { header "__algorithm/is_sorted_until.h" }
+      module iter_swap                { header "__algorithm/iter_swap.h" }
       module lexicographical_compare  { header "__algorithm/lexicographical_compare.h" }
       module lower_bound              { header "__algorithm/lower_bound.h" }
       module make_heap                { header "__algorithm/make_heap.h" }
@@ -305,6 +306,7 @@ module std [system] {
       module sort_heap                { header "__algorithm/sort_heap.h" }
       module stable_partition         { header "__algorithm/stable_partition.h" }
       module stable_sort              { header "__algorithm/stable_sort.h" }
+      module swap_ranges              { header "__algorithm/swap_ranges.h" }
       module transform                { header "__algorithm/transform.h" }
       module unique                   { header "__algorithm/unique.h" }
       module unique_copy              { header "__algorithm/unique_copy.h" }
@@ -419,6 +421,7 @@ module std [system] {
       module function                   { header "__functional/function.h" }
       module hash                       { header "__functional/hash.h" }
       module identity                   { header "__functional/identity.h" }
+      module is_transparent             { header "__functional/is_transparent.h" }
       module invoke                     { header "__functional/invoke.h" }
       module mem_fn                     { header "__functional/mem_fn.h"  }
       module mem_fun_ref                { header "__functional/mem_fun_ref.h"  }
@@ -548,6 +551,7 @@ module std [system] {
       module temporary_buffer         { header "__memory/temporary_buffer.h"         }
       module uninitialized_algorithms { header "__memory/uninitialized_algorithms.h" }
       module unique_ptr               { header "__memory/unique_ptr.h"               }
+      module uses_allocator           { header "__memory/uses_allocator.h"           }
     }
   }
   module mutex {
@@ -602,6 +606,7 @@ module std [system] {
       module concepts               { header "__ranges/concepts.h"              }
       module copyable_box           { header "__ranges/copyable_box.h"          }
       module data                   { header "__ranges/data.h"                  }
+      module drop_view              { header "__ranges/drop_view.h"             }
       module empty                  { header "__ranges/empty.h"                 }
       module empty_view             { header "__ranges/empty_view.h"            }
       module enable_borrowed_range  { header "__ranges/enable_borrowed_range.h" }
@@ -609,6 +614,7 @@ module std [system] {
       module ref_view               { header "__ranges/ref_view.h"              }
       module size                   { header "__ranges/size.h"                  }
       module subrange               { header "__ranges/subrange.h"              }
+      module transform_view         { header "__ranges/transform_view.h"        }
       module view_interface         { header "__ranges/view_interface.h"        }
     }
   }
@@ -635,6 +641,15 @@ module std [system] {
     export initializer_list
     export *
   }
+  module shared_mutex {
+    header "shared_mutex"
+    export version
+  }
+  module span {
+    header "span"
+    export ranges.__ranges.enable_borrowed_range
+    export version
+  }
   module sstream {
     header "sstream"
     // FIXME: should re-export istream, ostream, ios, streambuf, string?

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
index 91ea226cc40d4..cfa0857838c66 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
@@ -14,7 +14,7 @@
 
 // ADDITIONAL_COMPILE_FLAGS: -Wno-self-assign-overloaded
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
index 7b2e1bd111bd4..7fbb7df714079 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
@@ -14,7 +14,7 @@
 
 // ADDITIONAL_COMPILE_FLAGS: -Wno-self-move
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
index 324394f81ae69..e236d59fa8061 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
@@ -12,7 +12,7 @@
 
 // <copyable-box>::<copyable-box>()
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
index decbf0430af1b..9018e726e50b6 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
@@ -13,7 +13,7 @@
 // template<class ...Args>
 // explicit <copyable-box>::<copyable-box>(in_place_t, Args&& ...args);
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
index 4582effeff0a6..261bef2255cf0 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
@@ -13,7 +13,7 @@
 // T& <copyable-box>::operator*()
 // T const& <copyable-box>::operator*() const
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
index e1bd6287efc93..705309d140f57 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
@@ -12,7 +12,7 @@
 
 // bool <copyable-box>::__has_value() const
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <type_traits>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
index 4b094a703fb63..b8b5537d058ea 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
@@ -12,7 +12,7 @@
 
 // This test ensures that <copyable-box> behaves correctly when it holds an empty type.
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <cassert>
 #include <utility>

diff  --git a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
index 5e933e84d680e..3602a63834b7f 100644
--- a/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
+++ b/libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
@@ -12,7 +12,7 @@
 
 // Test various properties of <copyable-box>
 
-#include <__ranges/copyable_box.h>
+#include <ranges>
 
 #include <optional>
 

diff  --git a/libcxx/test/std/containers/views/span.sub/first.fail.cpp b/libcxx/test/std/containers/views/span.sub/first.fail.cpp
index b51196cb02789..9f48dc48c7078 100644
--- a/libcxx/test/std/containers/views/span.sub/first.fail.cpp
+++ b/libcxx/test/std/containers/views/span.sub/first.fail.cpp
@@ -19,6 +19,8 @@
 
 #include <span>
 
+#include <cstddef>
+
 #include "test_macros.h"
 
 constexpr int carr[] = {1, 2, 3, 4};

diff  --git a/libcxx/test/std/containers/views/span.sub/last.fail.cpp b/libcxx/test/std/containers/views/span.sub/last.fail.cpp
index 0ab11792b3b28..0a68dd0c7cade 100644
--- a/libcxx/test/std/containers/views/span.sub/last.fail.cpp
+++ b/libcxx/test/std/containers/views/span.sub/last.fail.cpp
@@ -19,6 +19,8 @@
 
 #include <span>
 
+#include <cstddef>
+
 #include "test_macros.h"
 
 constexpr int carr[] = {1, 2, 3, 4};

diff  --git a/libcxx/test/std/containers/views/span.sub/subspan.fail.cpp b/libcxx/test/std/containers/views/span.sub/subspan.fail.cpp
index 11b7136e08185..96c403e7bf636 100644
--- a/libcxx/test/std/containers/views/span.sub/subspan.fail.cpp
+++ b/libcxx/test/std/containers/views/span.sub/subspan.fail.cpp
@@ -21,6 +21,8 @@
 
 #include <span>
 
+#include <cstddef>
+
 #include "test_macros.h"
 
 constexpr int carr[] = {1, 2, 3, 4};

diff  --git a/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
index f5ca14d2e15b2..99e7d6154acb8 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.drop/dangling.cache.pass.cpp
@@ -16,6 +16,9 @@
 
 #include <ranges>
 
+#include <cstddef>
+#include <cstring>
+
 #include "test_macros.h"
 #include "types.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
index 4e1ffd5d3e556..b4ee76cf2660c 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_adopt_lock.pass.cpp
@@ -20,6 +20,7 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <mutex>
 #include "nasty_containers.h"
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
index fac91220eafc9..4e868298337f2 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_defer_lock.pass.cpp
@@ -20,6 +20,7 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <mutex>
 #include "nasty_containers.h"
 
 #include "test_macros.h"

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
index 43a4a633f01aa..57148253a4341 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock.pass.cpp
@@ -19,6 +19,7 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <mutex>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
index 0327b51d664d3..bb62472a64a5b 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_for.pass.cpp
@@ -18,6 +18,8 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <chrono>
+#include <mutex>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
index 9f8456199e04f..1a93163658891 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/try_lock_until.pass.cpp
@@ -18,6 +18,8 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <chrono>
+#include <mutex>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
index d03fa42ea0eb4..838baab8ddf39 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/unlock.pass.cpp
@@ -17,6 +17,7 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <system_error>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
index ecc47b888247b..8f15135d81c1c 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
@@ -17,6 +17,7 @@
 
 #include <shared_mutex>
 #include <cassert>
+#include <type_traits>
 
 #include "test_macros.h"
 

diff  --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
index 63f29e83a2100..495360d622ced 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/types.pass.cpp
@@ -21,6 +21,7 @@
 // };
 
 #include <shared_mutex>
+#include <mutex>
 #include <type_traits>
 
 #include "test_macros.h"


        


More information about the libcxx-commits mailing list