<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">As the maintainer of icecream, I have no interest in maintaining a separate preprocessor. It seems like a nightmare to maintain all the special cases, I also
 see modules is coming in the future C++ standard which I would have to understand. (and them modules 2 after that which might or might not be compatible enough for me)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Now if clang is willing to maintain a fast preprocessor that runs quick and spits out a list of files that I need to package up for my distributed build – I’m
 interested.  (I figure you already have to maintain a working preprocessor which means a lot of potential bugs are fixed – but I realize this would mean a number of special cases and I don’t know if you want to maintain that)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> cfe-dev [<a href="mailto:cfe-dev-bounces@lists.llvm.org">mailto:cfe-dev-bounces@lists.llvm.org</a>]
<b>On Behalf Of </b>Nico Weber via cfe-dev<br>
<b>Sent:</b> Thursday, May 11, 2017 12:15 PM<br>
<b>To:</b> Boris Kolpackov <<a href="mailto:boris@codesynthesis.com">boris@codesynthesis.com</a>><br>
<b>Cc:</b> cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>><br>
<b>Subject:</b> Re: [cfe-dev] Separate preprocess and compile: hack or feature?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Most distributed build systems I know about end up writing their own custom preprocessor to very quickly discover which .h files are included by a cc file (you don't need a full preprocessor for getting just that, and so you can be faster
 than clang -E), and then send .h and .cc files to the server based on content hashes, so that you don't need to send the full preprocessed text, but can send source files before preprocessing. <a href="https://github.com/facebookarchive/warp">https://github.com/facebookarchive/warp</a>
 was a somewhat recent example of this (but also, as you say, pump mode, and proprietary systems). (Your thread mentions that you do this for -M / /showIncludes, but you can just do this as part of regular compilation – not sure why you need this in a separate
 process?)<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">So while this doesn't answer your question, I'd expect that you won't need it, eventually :-)<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, May 11, 2017 at 5:05 AM, Boris Kolpackov via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<br>
<br>
In the build system I am working on we are looking at always performing<br>
the preprocessing and then C/C++ compilation as two separate clang/clang++<br>
invocations. The main reason is support for distributed compilation but<br>
see here[1] for other reasons.<br>
<br>
I realize that tools like ccache/distcc have been relying on this for<br>
a while (though see the 'direct' mode in ccache and 'pump' in distcc).<br>
However, some compilers apparently do not support this (for example,<br>
VC; see the above link for details).<br>
<br>
So I wonder, in the context of Clang, if this is just a hack that<br>
happens to work "for now" or if this is a feature that is expected<br>
to continue to work?<br>
<br>
Also, has anyone seen/heard of any real-world issues with compiling<br>
preprocessed source code?<br>
<br>
[1] <a href="https://www.reddit.com/r/cpp/comments/6abi99/rfc_issues_with_separate_preprocess_and_compile/" target="_blank">
https://www.reddit.com/r/cpp/comments/6abi99/rfc_issues_with_separate_preprocess_and_compile/</a><br>
<br>
<br>
Thanks,<br>
Boris<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>