================ @@ -1925,8 +1921,8 @@ ModuleLoadResult CompilerInstance::findOrCompileModuleAndReadAST( M = HS.lookupModule(ModuleName, ImportLoc, true, !IsInclusionDirective); // Check whether M refers to the file in the prebuilt module path. - if (M && M->getASTFile()) - if (auto ModuleFile = FileMgr->getFile(ModuleFilename)) + if (M && M->getASTFile() && M->getASTFile()) ---------------- jansvoboda11 wrote:
Good catch. I was playing around with squashing this into a single `if` statement like so: ```c++ // Check whether M refers to the file in the prebuilt module path. if (M && M->getASTFile() && *M->getASTFile() == FileMgr->getOptionalFileRef(ModuleFilename)) return M; ``` but didn't like how it wraps. https://github.com/llvm/llvm-project/pull/110014 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits