[libcxx-commits] [PATCH] D144322: [libc++][Modules] Make top level modules for all C++ headers with OS/clang versions

Ian Anderson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 5 22:42:13 PDT 2023


iana added a comment.

We had a meeting at Apple today including @ldionne and he's of the opinion that this script will be too difficult to maintain. We agreed to keep the static module map, but split it so that every header is a top level module. Depending on how that approach tests, especially with build performance, we might come back to the script, so I'm trying to run it through the CI just to make sure it runs properly on the builders with some older Python versions. Plus the other CI errors are from splitting the module and not necessarily from the specifics of how they end up split. I'll try to get this updated for the static module map tomorrow anyway.



================
Comment at: libcxx/docs/ReleaseNotes.rst:80
 
+- The ``std`` clang module has been broken up into separate top level modules per public header.
+
----------------
ldionne wrote:
> Is this noticeable by users? I don't think so, right? In that case I don't think there's a reason for a release note (even though this is indeed a big change).
Maybe? If anyone does `@import std;` in Objective-C++ then they'll notice


================
Comment at: libcxx/include/__threading_support:43
+// Include <math.h> here to work around that.
+# include <math.h>
 # include <pthread.h>
----------------
Mordante wrote:
> Has this been part of a separate patch?
No, this is only necessary when the mega module gets split. This one comes from a unit test, and I'm not sure how practical it is. I don't know how many people are trying to use libc++ with clang modules on OSes that don't have any clang modules in the OS headers. It's not really a supported configuration, clang modules have the expectation that modular headers only include modular headers.

What happens today is that libc++ has a single module, and if nothing in the OS has a module than the libc++ module will absorb all of the OS headers it includes into one huge gigantic mega module that has the whole world in it. In that case, everything can see everything else. But when the mega module breaks up, the non-modular OS headers will be randomly assigned, in this case the CI indicates that math.h is absorbing pthread.h/atomic_wide_counter.h


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144322/new/

https://reviews.llvm.org/D144322



More information about the libcxx-commits mailing list