summaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorIan Anderson <iana@apple.com>2023-05-12 18:36:57 -0700
committerIan Anderson <iana@apple.com>2023-05-13 23:02:40 -0700
commitf0917e92697d1a0157322e36557ccfa07df394ba (patch)
tree267ce60b0febede5e7e417a14aa75ea345907c7f /libcxx
parent4a9e55a5226e03f53a53485c56b7f199d9b45630 (diff)
downloadllvm-f0917e92697d1a0157322e36557ccfa07df394ba.tar.gz
[libc++][PSTL] Make the PSTL submodules only have one header
Module map generation for the private detail headers is easier done if each private header is by itself in a submodule. Move the __algorithm/pstl_backends into their own submodules. Reviewed By: philnik, #libc Differential Revision: https://reviews.llvm.org/D150503
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/module.modulemap.in16
-rwxr-xr-xlibcxx/test/libcxx/lint/lint_modulemap.sh.py3
2 files changed, 17 insertions, 2 deletions
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index e4b5dae5b833..c4d680eda593 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -320,13 +320,25 @@ module std [system] {
module partition_point { private header "__algorithm/partition_point.h" }
module pop_heap { private header "__algorithm/pop_heap.h" }
module prev_permutation { private header "__algorithm/prev_permutation.h" }
- module pstl {
+ module pstl_backends_cpu_backend {
private header "__algorithm/pstl_backends/cpu_backend.h"
+ export *
+ }
+ module pstl_backends_cpu_backends_any_of {
private header "__algorithm/pstl_backends/cpu_backends/any_of.h"
+ }
+ module pstl_backends_cpu_backends_backend {
private header "__algorithm/pstl_backends/cpu_backends/backend.h"
- private header "__algorithm/pstl_backends/cpu_backends/fill.h"
+ export *
+ }
+ module pstl_backends_cpu_backends_fill { private header "__algorithm/pstl_backends/cpu_backends/fill.h" }
+ module pstl_backends_cpu_backends_find_if {
private header "__algorithm/pstl_backends/cpu_backends/find_if.h"
+ }
+ module pstl_backends_cpu_backends_for_each {
private header "__algorithm/pstl_backends/cpu_backends/for_each.h"
+ }
+ module pstl_backends_cpu_backends_serial {
private header "__algorithm/pstl_backends/cpu_backends/serial.h"
}
module push_heap { private header "__algorithm/push_heap.h" }
diff --git a/libcxx/test/libcxx/lint/lint_modulemap.sh.py b/libcxx/test/libcxx/lint/lint_modulemap.sh.py
index 8bcd663eb8a0..85d2c4b01278 100755
--- a/libcxx/test/libcxx/lint/lint_modulemap.sh.py
+++ b/libcxx/test/libcxx/lint/lint_modulemap.sh.py
@@ -29,6 +29,9 @@ if __name__ == '__main__':
elif re.match(r'^\s*module (\w+)_fwd\s+[{] private header "__fwd/\1[.]h" [}]', line):
# It's a private submodule with forward declarations, such as <__fwd/span.h>.
pass
+ elif re.match(r'^\s*module (?:\w+_)*(\w+)\s+[{] private (textual )?header "__(\w+/)*\1[.]h" [}]', line):
+ # It's a private pstl submodule, such as <__algorithm/pstl_backends/cpu_backend.h>
+ pass
else:
okay = False
print("LINE DOESN'T MATCH REGEX in libcxx/include/module.modulemap.in!")