C++20 module protocol

Hi,
these files are the GCC implementation of the p1184 (wg21.link/p1184) protocol. Although part of GCC, they are entirely authored by me, so I hereby relicense[*] them under the Apache-2.0 with LLVM exception license, in the hope they may be useful in Clang's implementation. I also append the current documentation.

Iain and I are discussing whether a separate upstream project, from whence both GCC and Clang can sync, may be the best approach.

nathan

[*] Contributions to the FSF give back to the contributor a license to that code, allowing them to relicense as desired.

mapper-client.cc (16.5 KB)

mapper-client.h (3.74 KB)

mapper-server.cc (40.2 KB)

Thanks for designing/working on/contributing this! (I think it’s a rather neat thing & do hope it takes off/becomes adopted as the solution for this complicated new compiler surface area required by C++20 modules)

Very nice Nathan! Thank you for helping to foster cross-compiler collaboration,

-Chris

This is pretty cool, thanks for sharing Nathan!

Hi,

[...]

--
Nathan Sidwell

First, thanks for you works on modules !

I've few comments that might be already discussed elsewhere and maybe
off-topic, but still:

@item |@var{program}@r{[}?@var{ident}@r{]} @r{[}@var{args...}@r{]}
A program to spawn, and communicate with on its stdin/stdout streams.
Your @var{PATH} environment variable is searched for the program.
Arguments are separated by space characters, (it is not possible for
one of the arguments delivered to the program to contain a space).

Would adding a way to quote arguments feasible to allow spaces without
constraints ? For example if the program need a path argument.

@item @var{from}
The source path of the file containing the import or include.

This metavariable is not mentioned elsewhere and seems unused, is it
intended ?

@item @var{module}
A module name. Header unit names are absolute pathnames, or
pathnames prefixed with @samp{./}. Header units are resolved using
the include path.

This means that when using a mapping file, which is: