From ee2d4f5b9a2181e2c71341d34c7d2463f0c28cd1 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 17 Jul 2023 16:06:47 -0700 Subject: [PATCH] Disable -include b.hh => -include b.hh.{gch,pch} transition See https://maskray.me/blog/2023-07-16-precompiled-headers for the behavior. --- src/clang_tu.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clang_tu.cc b/src/clang_tu.cc index 2762aa8c..67f4856d 100644 --- a/src/clang_tu.cc +++ b/src/clang_tu.cc @@ -121,6 +121,10 @@ buildCompilerInvocation(const std::string &main, std::vector args, driver::Driver d(args[0], llvm::sys::getDefaultTargetTriple(), *diags, "ccls", vfs); #endif 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 comp(d.BuildCompilation(args)); if (!comp) return nullptr;