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:
Doug Gregor
2022-04-20 18:17:33 -07:00
parent 45ec725e43
commit 4116d7a3d7
18 changed files with 46 additions and 44 deletions

View File

@@ -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 =