Disable -include b.hh => -include b.hh.{gch,pch} transition

See https://maskray.me/blog/2023-07-16-precompiled-headers for the
behavior.
This commit is contained in:
Fangrui Song 2023-07-17 16:06:47 -07:00
parent ba38e13b93
commit ee2d4f5b9a

View File

@ -121,6 +121,10 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, "ccls", vfs); driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, "ccls", vfs);
#endif #endif
d.setCheckInputsExist(false); d.setCheckInputsExist(false);
#if LLVM_VERSION_MAJOR >= 15
// For -include b.hh, don't probe b.hh.{gch,pch} and change to -include-pch.
d.setProbePrecompiled(false);
#endif
std::unique_ptr<driver::Compilation> comp(d.BuildCompilation(args)); std::unique_ptr<driver::Compilation> comp(d.BuildCompilation(args));
if (!comp) if (!comp)
return nullptr; return nullptr;