================ @@ -3311,11 +3312,22 @@ ASTReader::ReadControlBlock(ModuleFile &F, SignatureBytes.end()); Blob = Blob.substr(ASTFileSignature::size); + // Use BaseDirectoryAsWritten to ensure we use the same path in the + // ModuleCache as when writing. + StoredFile = ReadPathBlob(BaseDirectoryAsWritten, Record, Idx, Blob); if (ImportedFile.empty()) { - // Use BaseDirectoryAsWritten to ensure we use the same path in the - // ModuleCache as when writing. - ImportedFile = - ReadPathBlob(BaseDirectoryAsWritten, Record, Idx, Blob); + ImportedFile = StoredFile; + } else { + auto ImportedFileRef = + PP.getFileManager().getOptionalFileRef(ImportedFile); + auto StoredFileRef = + PP.getFileManager().getOptionalFileRef(StoredFile); + if ((ImportedFileRef && StoredFileRef) && + (*ImportedFileRef != *StoredFileRef)) { + Diag(diag::warn_lazy_pcm_mismatch) << ImportedFile << StoredFile; + Diag(diag::note_module_file_imported_by) ---------------- cyndyishida wrote:
This note could be emitted twice if the compilation eventually fails (e.g. like in the test). It would be nice to avoid that redundancy, but I didn't see an obvious way to check for that. https://github.com/llvm/llvm-project/pull/137068 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits