ModuleInterface: avoid remarking missing prebuilt module for stdlib by default

Prebuilt modules are only available for certain toolchain and SDK combinations. Therefore,
building modules from interface, even for the stdlib, is expected to happen.

related: rdar://96701615
This commit is contained in:
Xi Ge
2022-07-14 13:34:40 -07:00
parent 93083f595d
commit cfb5fcda0f
3 changed files with 2 additions and 21 deletions

View File

@@ -981,21 +981,9 @@ class ModuleInterfaceLoaderImpl {
diag::rebuilding_module_from_interface, moduleName,
interfacePath);
};
// Diagnose only for the standard library; it should be prebuilt in typical
// workflows, but if it isn't, building it may take several minutes and a
// lot of memory, so users may think the compiler is busy-hung.
auto remarkRebuildStdlib = [&]() {
if (moduleName != "Swift")
return;
auto moduleTriple = getTargetSpecificModuleTriple(ctx.LangOpts.Target);
rebuildInfo.diagnose(ctx, diags, prebuiltCacheDir, SourceLoc(),
diag::rebuilding_stdlib_from_interface,
moduleTriple.str());
};
auto remarkRebuild = Opts.remarkOnRebuildFromInterface
? llvm::function_ref<void()>(remarkRebuildAll)
: remarkRebuildStdlib;
: nullptr;
bool failed = false;
std::string backupPath = getBackupPublicModuleInterfacePath();