[PATCH] D23125: Modules: add command line option to support loading prebuilt modules on demand, without parsing any module map

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 17 16:07:52 PDT 2016


manmanren added a comment.

Thanks,

Manman


================
Comment at: lib/Frontend/CompilerInstance.cpp:1502
@@ +1501,3 @@
+        Module = PP->getHeaderSearchInfo().lookupModule(ModuleName);
+        if (!Module) {
+          getDiagnostics().Report(ModuleNameLoc, diag::err_module_prebuilt)
----------------
Updated the patch to use error diagnostics instead of assertion.

<<<
It'd also be good to check that Module->ASTFile actually refers to the file that we found in the prebuilt module path, and not (say) to one of its transitive dependencies that ReadAST also loaded.

Did we already check this when creating the module in ASTReader?
      if (!ParentModule) {
        if (const FileEntry *CurFile = CurrentModule->getASTFile()) {
          if (CurFile != F.File) {
            ...
          }
        }

        CurrentModule->setASTFile(F.File);
      }



https://reviews.llvm.org/D23125





More information about the cfe-commits mailing list