<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 6 June 2017 at 04:55, Boris Kolpackov <span dir="ltr"><<a href="mailto:boris@codesynthesis.com" target="_blank">boris@codesynthesis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<span class=""><br>
Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> writes:<br>
<br>
> For us at least, this would add complexity (by adding a "no preprocessing"<br>
> mode) and likely not actually bring about any performance improvement --<br>
> the additional checks for "does this identifier have a defined macro" and<br>
> "is this a # at the start of a line" are extremely cheap.<br>
<br>
</span>Yes, you are probably right.<br>
<span class=""><br>
<br>
> Plus, as you mentioned above, this actually isn't what you want -- for<br>
> compilers like Clang (and recent versions of GCC) that take into account<br>
> the provenance of tokens (via macro expansion etc) when issuing diagnostics,<br>
> preprocessing prior to compilation proper harms the quality of experience<br>
> of your users.<br>
<br>
</span>The scenario I had in mind for -cpp-output is translation units that no<br>
longer use the preprocessor, not previously-preprocessed (to certain<br>
degree) units. Think of a C++ source file that uses module imports<br>
instead of #include's, [[assert:]] instead of assert(), etc.</blockquote><div><br></div><div>I think such a mode could be reasonable, especially in a post-Modules-TS world, for those people who (rationally or irrationally) are concerned about accidental macro expansion. That said, it makes more sense to me to control that with a flag like -fno-cpp rather than a -x value.</div></div></div></div>