[libcxx-commits] [PATCH] D103596: [libc++] Put __memory headers in submodules

Raphael Isemann via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 3 01:33:53 PDT 2021


teemperor created this revision.
teemperor added a reviewer: ldionne.
teemperor added a project: libc++.
teemperor requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Currently all the headers in __memory are not submodules of `std` but normal headers that get duplicated everywhere.

This patch marks all of them that can be parsed on their own as submodules so we only need one copy of them around.

This also means Clang no longer has to deal with making sense of all the duplicated declarations which leads to bogus
module build failures as seen in D103369 <https://reviews.llvm.org/D103369>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103596

Files:
  libcxx/include/module.modulemap


Index: libcxx/include/module.modulemap
===================================================================
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -550,6 +550,13 @@
   module __tree { header "__tree" export * }
   module __tuple { header "__tuple" export * }
   module __undef_macros { header "__undef_macros" export * }
+  module __memory {
+    // These can only be parsed when 'allocator' was defined.
+    textual header "__memory/allocator_traits.h"
+    textual header "__memory/allocation_guard.h"
+    umbrella "__memory"
+    export *
+  }
 
   module experimental {
     requires cplusplus11


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103596.349479.patch
Type: text/x-patch
Size: 637 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210603/d6b5d591/attachment-0001.bin>


More information about the libcxx-commits mailing list