[libcxx-commits] [libcxx] [libc++][modules] Rewrite the modulemap to have fewer top-level modules (PR #107638)
Vassil Vassilev via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 19 09:55:28 PDT 2024
vgvassilev wrote:
> > > > @ldionne, thank you for your efforts. This is a step in the direction where we would like to be. Do you plan further simplification of the modulemap and switching to even less modules?
> > >
> > >
> > > If we can, yes. I'd like to investigate umbrella headers to simplify the maintenance of the modulemap, but if you have other suggestions for simplifications and improvements I'd be all ears since I don't know what else we could do.
> >
> >
> > I think umbrella headers would help us reduce the size of the modulemap and help with removal/addition of header files.
>
> I agree.
>
> > Another super useful thing would be to introduce a CI check which essentially enforces self-contained header files -- every header file should be able to compile on its own. For instance, `cat header.h header.h | gcc -fsyntax-only -xc++ -`. This command concatenates header.h twice before compiling it to make sure it has proper include protectors and compiles on its own. Once our codebase becomes compliant to this simple rules we can do pretty much what we want in the modulemap.
>
> We already have basically that: [libcxx/test/libcxx/clang_modules_include.gen.py](https://github.com/llvm/llvm-project/blob/main/libcxx/test/libcxx/clang_modules_include.gen.py)
>
> Are you thinking about something slightly different?
I think I am proposing a complementary check which may be a superset of what `clang_modules_include.gen.py`. It's independent on if we have modules or not and it should pass on every header file (private included) of libcxx.
https://github.com/llvm/llvm-project/pull/107638
More information about the libcxx-commits
mailing list