<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Tue, Mar 5, 2019 at 12:59 PM Gabriel Dos Reis via Modules <<a href="mailto:modules@lists.isocpp.org">modules@lists.isocpp.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-4431813171189710910WordSection1">
<ul style="margin-top:0in" type="disc">
<li class="gmail-m_-4431813171189710910MsoListParagraph" style="margin-left:0in">If so, then I think we are just using different terms for the same thing. If not, can you explain what is different?<u></u><u></u></li></ul>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The difference here is the need for new #pragma with special non-standard semantics.</p></div></div></blockquote><div><br></div><div>Can you provide an example of what a reasonable output would be for the following?</div><div><br></div><div>// ================= interface.cppmi</div><div>export module i;</div><div><br></div><div>export void foo() {</div><div> // ...</div><div>}</div><div>// ================= user.cpp</div><div>import i;</div><div><br></div><div>void a() {</div><div> foo();</div><div>}</div><div>// =================</div><div><br></div><div>For reference clang (should) output the following:</div><div><br></div><div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">#pragma clang module build i</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># 1 "<built-in>"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># 1 "interface.cppmi"</span></p>
<div>export module i;</div><div><br></div><div>export void foo();</div>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">#pragma clang module endbuild /*i*/</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># 1 "<built-in>"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"># 1 "user.cpp"</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">import i;</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">void a() {</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> foo();</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p></div><div><br></div><div>It currently actually outputs <span style="color:rgb(0,0,0);font-family:Menlo;font-size:11px"><<<INVALID BUFFER>> </span>instead of the interface because it comes from a pcm (BMI), but it works for header imports.</div><div><br></div><div>- Michael Spencer<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-4431813171189710910WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border-style:none none none solid;border-left-width:1.5pt;border-left-color:blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> Mathias Stearn <<a href="mailto:redbeard0531%2Bisocpp@gmail.com" target="_blank">redbeard0531+isocpp@gmail.com</a>> <br>
<b>Sent:</b> Tuesday, March 5, 2019 12:47 PM<br>
<b>To:</b> Ben Boeckel via Modules <<a href="mailto:modules@lists.isocpp.org" target="_blank">modules@lists.isocpp.org</a>><br>
<b>Cc:</b> Ben Craig <<a href="mailto:ben.craig@ni.com" target="_blank">ben.craig@ni.com</a>>; Gabriel Dos Reis <<a href="mailto:gdr@microsoft.com" target="_blank">gdr@microsoft.com</a>>; WG21 Tooling Study Group SG15 <<a href="mailto:tooling@open-std.org" target="_blank">tooling@open-std.org</a>>; Nathan Sidwell <<a href="mailto:nathan@acm.org" target="_blank">nathan@acm.org</a>><br>
<b>Subject:</b> Re: [isocpp-modules] Round2: Path to modules with old bad build systems<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Mar 5, 2019 at 2:32 PM Gabriel Dos Reis via Modules <<a href="mailto:modules@lists.isocpp.org" target="_blank">modules@lists.isocpp.org</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-left-width:1pt;border-left-color:rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Specifically, I don't understand why the compiler would go through the troubles of emitting something like that when it would be simpler to just supply the switch -ftreat-imports-as-glorified-headers. The sources could still be preprocessed
and retain the imports, etc.<u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">When you pass -ftreat-imports-as-glorified-headers, can also tell the compiler to just preprocess[1], then take just the output from that and hand it to the compiler again to have it translated to an object file and have it behave the same
as if it was working with the original files? If so, then I think we are just using different terms for the same thing. If not, can you explain what is different?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">[1] Currently, with gcc and clang, you need to "partially preprocess" using -fdirectives-only or -frewrite-includes because those tools behave differently when compiling TUs that have already been fully preprocessed. I haven't tried doing
a similar experiment with MSVC to know how well it handles fully preprocessed files.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Modules mailing list<br>
<a href="mailto:Modules@lists.isocpp.org" target="_blank">Modules@lists.isocpp.org</a><br>
Subscription: <a href="http://lists.isocpp.org/mailman/listinfo.cgi/modules" rel="noreferrer" target="_blank">http://lists.isocpp.org/mailman/listinfo.cgi/modules</a><br>
Link to this post: <a href="http://lists.isocpp.org/modules/2019/03/0167.php" rel="noreferrer" target="_blank">http://lists.isocpp.org/modules/2019/03/0167.php</a><br>
</blockquote></div></div></div></div></div></div></div></div></div></div>