[Package CMO] Diagnose missing library-evolution flag.

This PR ensures library-evolution is enabled for Package CMO; without it,
it previously fell back to regular CMO, which caused mismatching serialization
attributes if importing another module that had Package CMO enbaled, causing
an assert fail for loadable types.

Resolves rdar://135308288
This commit is contained in:
elsh
2024-09-05 03:26:53 -07:00
parent 9ac56f2f05
commit 66b504a253
4 changed files with 54 additions and 2 deletions

View File

@@ -2688,6 +2688,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
Diags.diagnose(SourceLoc(), diag::ignoring_option_requires_option,
"-package-cmo",
"-allow-non-resilient-access");
} else if (!FEOpts.EnableLibraryEvolution) {
Diags.diagnose(SourceLoc(), diag::package_cmo_requires_library_evolution);
} else {
Opts.EnableSerializePackage = true;
Opts.CMOMode = CrossModuleOptimizationMode::Default;