[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 08:24:15 PDT 2024


jansvoboda11 wrote:

> > You can have a project that has both C and C++ implementation files that end up including the same header files from the C standard library. One can be compiled under C11 (without separator support), the other under C++14 (with separator support).
> 
> Thanks. I had considered this very lightly, and in my mind, I thought that this would result in two separate passes of scanning - and so, two separate scanning services. Maybe I am wrong?

Single scanning service will be used across the entire build, across build targets, regardless of language and the standard of the compilation.

> Thank you for the additional context and bits of knowledge, super helpful. I'll put up a separate PR that does the following:
> 
> 1. reverts the changes within this PR
> 2. checks if the lexer has `ParsingPreprocessorDirective` property `true` or `false` and allow for the numeric lexing to happen in that case.
> 
> Let me know if it is preferable for history etc. to have two separate PRs - one for the revert and one for the lexer to relax the CPP14/C23 constraint during the preprocessing phase.

Yes, splitting this into two PRs would be great.

https://github.com/llvm/llvm-project/pull/93753


More information about the cfe-commits mailing list