[cfe-dev] Language not recognized: 'c++-module-cpp-output'

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 6 16:16:34 PDT 2017


On 6 June 2017 at 04:55, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi Richard,
>
> Richard Smith <richard at metafoo.co.uk> writes:
>
> > For us at least, this would add complexity (by adding a "no
> preprocessing"
> > mode) and likely not actually bring about any performance improvement --
> > the additional checks for "does this identifier have a defined macro" and
> > "is this a # at the start of a line" are extremely cheap.
>
> Yes, you are probably right.
>
>
> > Plus, as you mentioned above, this actually isn't what you want -- for
> > compilers like Clang (and recent versions of GCC) that take into account
> > the provenance of tokens (via macro expansion etc) when issuing
> diagnostics,
> > preprocessing prior to compilation proper harms the quality of experience
> > of your users.
>
> The scenario I had in mind for -cpp-output is translation units that no
> longer use the preprocessor, not previously-preprocessed (to certain
> degree) units. Think of a C++ source file that uses module imports
> instead of #include's, [[assert:]] instead of assert(), etc.


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170606/267fdd1c/attachment.html>


More information about the cfe-dev mailing list