Merge pull request #64074 from xymus/report-mismatching-module-version-to-stderr

[Serialization] Remark only on stderr when loading a mismatching swiftmodule
This commit is contained in:
Alexis Laferrière
2023-03-03 15:14:37 -08:00
committed by GitHub
2 changed files with 6 additions and 8 deletions

View File

@@ -850,11 +850,13 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
loadedModuleFile->mayHaveDiagnosticsPointingAtBuffer())
OrphanedModuleFiles.push_back(std::move(loadedModuleFile));
} else {
// Report non-fatal compiler tag mismatch.
// Report non-fatal compiler tag mismatch on stderr only to avoid
// polluting the IDE UI.
if (!loadInfo.problematicRevision.empty()) {
Ctx.Diags.diagnose(*diagLoc,
diag::serialization_module_problematic_revision,
loadInfo.problematicRevision, moduleBufferID);
llvm::errs() << "remark: compiled module was created by a different " <<
"version of the compiler '" <<
loadInfo.problematicRevision <<
"': " << moduleBufferID << "\n";
}
}