[cfe-dev] Will Clang use PCH format to implement C++20 module system?

Yafei Liu via cfe-dev cfe-dev at lists.llvm.org
Tue Jan 7 04:10:41 PST 2020


Hey David, I got another question, do you know how will Clang handle
modules which is compiled by other compiler? For example GCC? The AST
serialization is not the same.

On Tue, Jan 7, 2020 at 2:30 AM David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Mon, Jan 6, 2020 at 2:28 AM Yafei Liu via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hi all, I'm curious if the PCH format will be used to implement C++20
>> module system? Any Clang community discussions or documents on this?
>>
>
> More or less. The basic AST serialization system is already shared between
> PCH, Clang Header Modules, and preliminary support for C++20 Modules. Not
> exactly the same, because the semantics of each are slightly different -
> but the core AST serialization is common across all 3.
>
>
>> What's more, I'm inventing a language using LLVM, and I want to generate
>> some middle layer to communicate with c++ module, so is there any tools or
>> apis to generate a PCH?
>>
>
> None that I know of. The only cross-language binding like that that I know
> of is Swift, which is one-way to the best of my knowledge (so Swift doesn't
> have to generate Clang-compatible AST files (PCH/PCM/whatever) - it only
> has to be able to read them). I imagine Swift's binary module
> representation might be similar for ease of interoperability, but I don't
> actually know.
>
> - Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200107/4fc4495f/attachment.html>


More information about the cfe-dev mailing list