<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 27, 2017 at 2:53 AM Boris Kolpackov via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to understand how Clang's Modules TS will work so that we<br>
have a general-enough model in the build system.<br>
<br>
Consider these two modules and a consumer:<br>
<br>
// module core<br>
export module core;<br>
export void f (int);<br>
<br>
// module extra<br>
export module extra;<br>
import core;<br>
export inline void g (int x) {f (x);}<br>
<br>
// consumer<br>
import extra;<br>
int main () {g ();}<br>
<br>
Currently, when compiling the consumer (with -fmodules-ts), Clang only<br>
requires the binary module interface (BMI) for extra. In contrast, VC<br>
and GCC require both extra and core (note: even though core is not<br>
re-exported from extra).<br>
<br>
The Clang's model is definitely more desirable from the build system's<br>
perspective, especially for distributed compilation. So I wonder if this<br>
is accidental and will change in the future or if this is something that<br>
Clang is committed to, so to speak?<br></blockquote><div><br>I believe this functionality is intentional (after deploying pre-TS modules at Google & finding the number of files necessary without this feature to be problematic (maybe hitting issues with command line length? Not sure what the particular constraint was that it was running up against))<br><br>CC'd Richard to correct/clarify/etc<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Here is a more interesting variant of the extra module that highlights<br>
some of the issues to consider:<br>
<br>
// module extra<br>
export module extra;<br>
import core;<br>
export template <typename T> void g (T x) {f (x);}<br>
<br>
Now f() can only be resolved (via ADL) when g() is instantiated.<br>
<br>
Thanks,<br>
Boris<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>