mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Support Package CMO
* Add a new flag -experimental-package-cmo that requires -experimental-allow-non-resilient-access. * Support serializing package decls for CMO in package if enabled. * Only applies to default mode CMO. * Unlike the existing CMO, package CMO can be built with -enable-library-evolution as package modules are required to be built together in the same project. * Create hasPublicOrPackageVisibility to opt in for package decls; needed for CMO, SILVerifier, and other call sites that verify or determine codegen. Resolves rdar://121976014
This commit is contained in:
@@ -2335,6 +2335,18 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
} else if (Args.hasArg(OPT_EnbaleCMOEverything)) {
|
||||
Opts.CMOMode = CrossModuleOptimizationMode::Everything;
|
||||
}
|
||||
|
||||
if (Args.hasArg(OPT_ExperimentalPackageCMO)) {
|
||||
if (!FEOpts.AllowNonResilientAccess) {
|
||||
Diags.diagnose(SourceLoc(), diag::ignoring_option_requires_option,
|
||||
"-experimental-package-cmo",
|
||||
"-experimental-allow-non-resilient-access");
|
||||
} else {
|
||||
Opts.EnableSerializePackage = true;
|
||||
Opts.CMOMode = CrossModuleOptimizationMode::Default;
|
||||
}
|
||||
}
|
||||
|
||||
Opts.EnableStackProtection =
|
||||
Args.hasFlag(OPT_enable_stack_protector, OPT_disable_stack_protector,
|
||||
Opts.EnableStackProtection);
|
||||
|
||||
Reference in New Issue
Block a user