[clang-tools-extra] [clangd] [Modules] Use ASTReader directly in IsModuleFileUpToDate (PR #113879)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 19:53:42 PDT 2024


================
@@ -127,33 +127,39 @@ struct ModuleFile {
   std::string ModuleFilePath;
 };
 
-bool IsModuleFileUpToDate(PathRef ModuleFilePath,
-                          const PrerequisiteModules &RequisiteModules,
-                          llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
+bool IsModuleFileUpToDate(
+    PathRef ModuleFilePath,
+    const PrerequisiteModules &RequisiteModules,
+    const CompilerInvocation &CI,
+    llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
+  CompilerInstance Clang;
----------------
ChuanqiXu9 wrote:

We may not be able to do it since ASTReader is stateful. If the ASTReader reads multiple module files (BMIs), the ASTReader will check automatically if these module files conflicts with each other. It doesn't matter in an ideal world. But it is common that users wrote invalid codes especially during the process of editing.

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


More information about the cfe-commits mailing list