[clang-tools-extra] [clangd] Add includes from source to non-self-contained headers (PR #72479)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 22 22:26:03 PST 2023


HighCommander4 wrote:

A somewhat narrow use case where this approach might be workable is unity builds (groups of source files batched together to be compiled as a single translation unit for build performance).

That's a situation where the non-self-contained files of interest (the individual source files that are included in such a batch) have precisely one includer, their incoming preprocessor state can be replicated precisely using `-include` flags, and the intervention can be limited to them (it wouldn't apply to header files).

Of course, the including file is not likely to be open in this case, so we'd want something like an include graph stored in the index (as proposed in #123) to consult.

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


More information about the cfe-commits mailing list