[libcxx-commits] [libcxx] ddcb2d1 - [libc++] Improves modular build.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 1 12:24:38 PDT 2022


Author: Mark de Wever
Date: 2022-11-01T20:24:33+01:00
New Revision: ddcb2d19b372913b13f06a7824b49be57480718f

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

LOG: [libc++] Improves modular build.

Makes sure headers having a xxx_result as return type export the proper
header. Without exporting these modularized headers are not self
contained.

This is related to D136045.

Reviewed By: #libc, ldionne

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

Added: 
    

Modified: 
    libcxx/include/__format/formatter_output.h
    libcxx/include/__ranges/lazy_split_view.h
    libcxx/include/module.modulemap.in

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h
index 5a1dbccae7604..4f2c0445c02e5 100644
--- a/libcxx/include/__format/formatter_output.h
+++ b/libcxx/include/__format/formatter_output.h
@@ -10,7 +10,6 @@
 #ifndef _LIBCPP___FORMAT_FORMATTER_OUTPUT_H
 #define _LIBCPP___FORMAT_FORMATTER_OUTPUT_H
 
-#include <__algorithm/in_out_result.h>
 #include <__algorithm/ranges_copy.h>
 #include <__algorithm/ranges_fill_n.h>
 #include <__algorithm/ranges_transform.h>

diff  --git a/libcxx/include/__ranges/lazy_split_view.h b/libcxx/include/__ranges/lazy_split_view.h
index 852b0b227adca..3a95075884b93 100644
--- a/libcxx/include/__ranges/lazy_split_view.h
+++ b/libcxx/include/__ranges/lazy_split_view.h
@@ -10,7 +10,6 @@
 #ifndef _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H
 #define _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H
 
-#include <__algorithm/in_in_result.h>
 #include <__algorithm/ranges_find.h>
 #include <__algorithm/ranges_mismatch.h>
 #include <__concepts/constructible.h>

diff  --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index c33f5a831afda..79c7c3d354c8d 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -324,10 +324,22 @@ module std [system] {
         private header "__algorithm/ranges_clamp.h"
         export functional.__functional.ranges_operations
       }
-      module ranges_copy                     { private header "__algorithm/ranges_copy.h" }
-      module ranges_copy_backward            { private header "__algorithm/ranges_copy_backward.h" }
-      module ranges_copy_if                  { private header "__algorithm/ranges_copy_if.h" }
-      module ranges_copy_n                   { private header "__algorithm/ranges_copy_n.h" }
+      module ranges_copy {
+        private header "__algorithm/ranges_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_copy_backward {
+        private header "__algorithm/ranges_copy_backward.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_copy_if {
+        private header "__algorithm/ranges_copy_if.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_copy_n {
+        private header "__algorithm/ranges_copy_n.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_count                    { private header "__algorithm/ranges_count.h" }
       module ranges_count_if                 { private header "__algorithm/ranges_count_if.h" }
       module ranges_equal                    { private header "__algorithm/ranges_equal.h" }
@@ -342,8 +354,14 @@ module std [system] {
       module ranges_find_first_of            { private header "__algorithm/ranges_find_first_of.h" }
       module ranges_find_if                  { private header "__algorithm/ranges_find_if.h" }
       module ranges_find_if_not              { private header "__algorithm/ranges_find_if_not.h" }
-      module ranges_for_each                 { private header "__algorithm/ranges_for_each.h" }
-      module ranges_for_each_n               { private header "__algorithm/ranges_for_each_n.h" }
+      module ranges_for_each {
+        private header "__algorithm/ranges_for_each.h"
+        export algorithm.__algorithm.in_fun_result
+      }
+      module ranges_for_each_n {
+        private header "__algorithm/ranges_for_each_n.h"
+        export algorithm.__algorithm.in_fun_result
+      }
       module ranges_generate                 { private header "__algorithm/ranges_generate.h" }
       module ranges_generate_n               { private header "__algorithm/ranges_generate_n.h" }
       module ranges_includes {
@@ -393,7 +411,10 @@ module std [system] {
         private header "__algorithm/ranges_max_element.h"
         export functional.__functional.ranges_operations
       }
-      module ranges_merge                    { private header "__algorithm/ranges_merge.h" }
+      module ranges_merge {
+        private header "__algorithm/ranges_merge.h"
+        export algorithm.__algorithm.in_in_out_result
+      }
       module ranges_min {
         private header "__algorithm/ranges_min.h"
         export functional.__functional.ranges_operations
@@ -405,16 +426,28 @@ module std [system] {
       module ranges_minmax {
         private header "__algorithm/ranges_minmax.h"
         export functional.__functional.ranges_operations
+        export algorithm.__algorithm.min_max_result
       }
       module ranges_minmax_element {
         private header "__algorithm/ranges_minmax_element.h"
         export functional.__functional.ranges_operations
+        export algorithm.__algorithm.min_max_result
+      }
+      module ranges_mismatch {
+        private header "__algorithm/ranges_mismatch.h"
+        export algorithm.__algorithm.in_in_result
+      }
+      module ranges_move {
+        private header "__algorithm/ranges_move.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_move_backward {
+        private header "__algorithm/ranges_move_backward.h"
+        export algorithm.__algorithm.in_out_result
       }
-      module ranges_mismatch                 { private header "__algorithm/ranges_mismatch.h" }
-      module ranges_move                     { private header "__algorithm/ranges_move.h" }
-      module ranges_move_backward            { private header "__algorithm/ranges_move_backward.h" }
       module ranges_next_permutation {
         private header "__algorithm/ranges_next_permutation.h"
+        export algorithm.__algorithm.in_found_result
         export functional.__functional.ranges_operations
       }
       module ranges_none_of                  { private header "__algorithm/ranges_none_of.h" }
@@ -424,10 +457,12 @@ module std [system] {
       }
       module ranges_partial_sort {
         private header "__algorithm/ranges_partial_sort.h"
+        export algorithm.__algorithm.in_out_result
         export functional.__functional.ranges_operations
       }
       module ranges_partial_sort_copy {
         private header "__algorithm/ranges_partial_sort_copy.h"
+        export algorithm.__algorithm.in_out_out_result
         export functional.__functional.ranges_operations
       }
       module ranges_partition                { private header "__algorithm/ranges_partition.h" }
@@ -439,6 +474,7 @@ module std [system] {
       }
       module ranges_prev_permutation {
         private header "__algorithm/ranges_prev_permutation.h"
+        export algorithm.__algorithm.in_found_result
         export functional.__functional.ranges_operations
       }
       module ranges_push_heap {
@@ -446,28 +482,54 @@ module std [system] {
         export functional.__functional.ranges_operations
       }
       module ranges_remove                   { private header "__algorithm/ranges_remove.h" }
-      module ranges_remove_copy              { private header "__algorithm/ranges_remove_copy.h" }
-      module ranges_remove_copy_if           { private header "__algorithm/ranges_remove_copy_if.h" }
+      module ranges_remove_copy {
+        private header "__algorithm/ranges_remove_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_remove_copy_if {
+        private header "__algorithm/ranges_remove_copy_if.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_remove_if                { private header "__algorithm/ranges_remove_if.h" }
       module ranges_replace                  { private header "__algorithm/ranges_replace.h" }
-      module ranges_replace_copy             { private header "__algorithm/ranges_replace_copy.h" }
-      module ranges_replace_copy_if          { private header "__algorithm/ranges_replace_copy_if.h" }
+      module ranges_replace_copy {
+        private header "__algorithm/ranges_replace_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_replace_copy_if {
+        private header "__algorithm/ranges_replace_copy_if.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_replace_if               { private header "__algorithm/ranges_replace_if.h" }
       module ranges_reverse                  { private header "__algorithm/ranges_reverse.h" }
-      module ranges_reverse_copy             { private header "__algorithm/ranges_reverse_copy.h" }
+      module ranges_reverse_copy {
+        private header "__algorithm/ranges_reverse_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_rotate                   { private header "__algorithm/ranges_rotate.h" }
-      module ranges_rotate_copy              { private header "__algorithm/ranges_rotate_copy.h" }
+      module ranges_rotate_copy {
+        private header "__algorithm/ranges_rotate_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_sample                   { private header "__algorithm/ranges_sample.h" }
       module ranges_search                   { private header "__algorithm/ranges_search.h" }
       module ranges_search_n                 { private header "__algorithm/ranges_search_n.h" }
-      module ranges_set_
diff erence           { private header "__algorithm/ranges_set_
diff erence.h" }
-      module ranges_set_intersection         { private header "__algorithm/ranges_set_intersection.h" }
+      module ranges_set_
diff erence {
+        private header "__algorithm/ranges_set_
diff erence.h"
+        export algorithm.__algorithm.in_out_result
+      }
+      module ranges_set_intersection {
+        private header "__algorithm/ranges_set_intersection.h"
+        export algorithm.__algorithm.in_in_out_result
+      }
       module ranges_set_symmetric_
diff erence {
         private header "__algorithm/ranges_set_symmetric_
diff erence.h"
+        export algorithm.__algorithm.in_in_out_result
         export functional.__functional.ranges_operations
       }
       module ranges_set_union {
-         private header "__algorithm/ranges_set_union.h"
+        private header "__algorithm/ranges_set_union.h"
+        export algorithm.__algorithm.in_in_out_result
         export functional.__functional.ranges_operations
       }
       module ranges_shuffle                  { private header "__algorithm/ranges_shuffle.h" }
@@ -484,13 +546,23 @@ module std [system] {
         private header "__algorithm/ranges_stable_sort.h"
         export functional.__functional.ranges_operations
       }
-      module ranges_swap_ranges              { private header "__algorithm/ranges_swap_ranges.h" }
-      module ranges_transform                { private header "__algorithm/ranges_transform.h" }
+      module ranges_swap_ranges {
+        private header "__algorithm/ranges_swap_ranges.h"
+        export algorithm.__algorithm.in_in_result
+      }
+      module ranges_transform {
+        private header "__algorithm/ranges_transform.h"
+        export algorithm.__algorithm.in_in_out_result
+        export algorithm.__algorithm.in_out_result
+      }
       module uniform_random_bit_generator_adaptor {
         private header "__algorithm/uniform_random_bit_generator_adaptor.h"
       }
       module ranges_unique                   { private header "__algorithm/ranges_unique.h" }
-      module ranges_unique_copy              { private header "__algorithm/ranges_unique_copy.h" }
+      module ranges_unique_copy {
+        private header "__algorithm/ranges_unique_copy.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module ranges_upper_bound {
         private header "__algorithm/ranges_upper_bound.h"
         export functional.__functional.ranges_operations
@@ -969,7 +1041,10 @@ module std [system] {
       module destruct_n                      { private header "__memory/destruct_n.h" }
       module pointer_traits                  { private header "__memory/pointer_traits.h" }
       module ranges_construct_at             { private header "__memory/ranges_construct_at.h" }
-      module ranges_uninitialized_algorithms { private header "__memory/ranges_uninitialized_algorithms.h" }
+      module ranges_uninitialized_algorithms {
+        private header "__memory/ranges_uninitialized_algorithms.h"
+        export algorithm.__algorithm.in_out_result
+      }
       module raw_storage_iterator            { private header "__memory/raw_storage_iterator.h" }
       module shared_ptr                      { private header "__memory/shared_ptr.h" }
       module swap_allocator                  { private header "__memory/swap_allocator.h" }


        


More information about the libcxx-commits mailing list