ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch

This commit is contained in:
Erik Eckstein
2021-04-15 14:06:17 +02:00
parent 7123d2614b
commit d49de1a982
4 changed files with 14 additions and 5 deletions

View File

@@ -203,9 +203,14 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
getSwiftInterfaceCompilerVersionForCurrentCompiler(
SubInstance.getASTContext());
StringRef emittedByCompiler = info.CompilerVersion;
diagnose(diag::module_interface_build_failed, isTypeChecking,
moduleName, emittedByCompiler == builtByCompiler,
emittedByCompiler, builtByCompiler);
if (!isTypeChecking && emittedByCompiler != builtByCompiler) {
diagnose(diag::module_interface_build_failed_mismatching_compiler,
moduleName, emittedByCompiler, builtByCompiler);
} else {
diagnose(diag::module_interface_build_failed, isTypeChecking,
moduleName, emittedByCompiler == builtByCompiler,
emittedByCompiler, builtByCompiler);
}
}
};