<div dir="ltr">It won't - there are no plans for precompiled modules to be portable between compilers. (someone at Microsoft has been having some discussions about maybe making some of that possible - but there's a fair bit of resistance, and so far as I know from Clang and GCC there's no work in that direction)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 7, 2020 at 4:10 AM Yafei Liu <<a href="mailto:yfliu@mobvoi.com">yfliu@mobvoi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 7, 2020 at 2:30 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 6, 2020 at 2:28 AM Yafei Liu via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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?</div></blockquote><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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?<br></div></div></blockquote><div><br>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.<br><br>- Dave</div></div></div>
</blockquote></div>
</blockquote></div>