mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Base LexicalLifetimes dflt on SILOpts::CopyProp.
Previously, the default value for SILOptions::LexicalLifetimes was based on a copy propagation behavior (which can then be overridden by the flags for lexical lifetimems) only when the copy propagation was explicitly specified. Instead, set base the default value for this option (SILOptions::LexicalLifetimes) on the effective copy propagation behavior (i.e. SILOptions::CopyPropagation) regardless of whether an explicit behavior has been specified. Doing so will ensure that the desired behavior occurs as the default behavior for copy-propagation changes, but for now this change is NFC.
This commit is contained in:
@@ -1522,13 +1522,14 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
return true;
|
||||
}
|
||||
|
||||
// -enable-copy-propagation implies -enable-lexical-lifetimes unless
|
||||
// otherwise specified.
|
||||
if (Args.hasArg(OPT_enable_copy_propagation))
|
||||
// Unless overridden below, enabling copy propagation means enabling lexical
|
||||
// lifetimes.
|
||||
if (Opts.CopyPropagation == CopyPropagationOption::On)
|
||||
Opts.LexicalLifetimes = LexicalLifetimesOption::On;
|
||||
|
||||
// -disable-copy-propagation implies -enable-lexical-lifetimes=false
|
||||
if (Args.hasArg(OPT_disable_copy_propagation))
|
||||
// Unless overridden below, disable copy propagation means disabling lexical
|
||||
// lifetimes.
|
||||
if (Opts.CopyPropagation == CopyPropagationOption::Off)
|
||||
Opts.LexicalLifetimes = LexicalLifetimesOption::DiagnosticMarkersOnly;
|
||||
|
||||
// If move-only is enabled, always enable lexical lifetime as well. Move-only
|
||||
|
||||
Reference in New Issue
Block a user