Merge pull request #36928 from eeckstein/module-build-error-message

ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch
This commit is contained in:
eeckstein
2021-04-16 08:55:32 +02:00
committed by GitHub
4 changed files with 14 additions and 5 deletions

View File

@@ -210,9 +210,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);
}
}
};