mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename the -strict-concurrency= options to be more descriptive.
The three options are now: * `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default) * `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable. * `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
This commit is contained in:
@@ -694,12 +694,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
|
||||
// Swift 6+ uses the strictest concurrency level.
|
||||
if (Opts.isSwiftVersionAtLeast(6)) {
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::On;
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;
|
||||
} else if (const Arg *A = Args.getLastArg(OPT_strict_concurrency)) {
|
||||
auto value = llvm::StringSwitch<Optional<StrictConcurrency>>(A->getValue())
|
||||
.Case("off", StrictConcurrency::Off)
|
||||
.Case("limited", StrictConcurrency::Limited)
|
||||
.Case("on", StrictConcurrency::On)
|
||||
.Case("explicit", StrictConcurrency::Explicit)
|
||||
.Case("targeted", StrictConcurrency::Targeted)
|
||||
.Case("complete", StrictConcurrency::Complete)
|
||||
.Default(None);
|
||||
|
||||
if (value)
|
||||
@@ -709,10 +709,10 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
A->getAsString(Args), A->getValue());
|
||||
|
||||
} else if (Args.hasArg(OPT_warn_concurrency)) {
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::On;
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;
|
||||
} else {
|
||||
// Default to "limited" checking in Swift 5.x.
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::Limited;
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::Targeted;
|
||||
}
|
||||
|
||||
Opts.WarnImplicitOverrides =
|
||||
|
||||
Reference in New Issue
Block a user