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

Boris Kolpackov via cfe-dev cfe-dev at lists.llvm.org
Sun Jun 4 01:59:37 PDT 2017


David Blaikie <dblaikie at gmail.com> writes:

> Not sure I follow this - that's a benefit to the build system in knowing
> whether it needs to preprocess the file before sending it to the remote
> system. But not a benefit to the compiler/clang.

A compiler could optimize things if it knows that it doesn't need to do
macro expansion, handle #include's, etc. I agree it may not be worth it
right now. But I am wondering if it makes sense to keep the door open for
this kind of optimizations in the future.


> I don't think it can, but maybe - the issue being that the contents of the
> assert expression mustn't be evaluated or even parsed, etc, if assertions
> are not enabled.

I don't think it will affect a lot of code if it is parsed and discarded
when disabled. One will have to do things differently based on NDEBUG to
craft something like this. Which will then disqualify it from this "already
preprocessed" mode.

In fact, I would very much like to have a version of assert() that always
evaluates the condition.

Boris



More information about the cfe-dev mailing list