[clang] Pass LangOpts from CompilerInstance to DependencyScanningWorker (PR #93753)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 13:06:18 PST 2024
jansvoboda11 wrote:
> But the list of tokens depends on things like what features are enabled, right? e.g., `-fchar8_t` introduces a new keyword, while `_Atomic` isn't a keyword in OpenCL, and `bool` is only a keyword in C23 and later but is always a keyword in C++, etc. Ah, but in terms of dependency scanning, whether those are keywords or not probably doesn't matter? And because we expose things like `embed` as a keyword in all language modes, not just C23, the language standard doesn't matter either?
I touched on this in https://github.com/llvm/llvm-project/pull/95798#discussion_r1852892503. We could represent these cases in the token list such that when the scanner feeds it to the `LanguageOptions`-aware preprocessor, it can still emit corresponding diagnostics.
https://github.com/llvm/llvm-project/pull/93753
More information about the cfe-commits
mailing list