mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #67974 from sophiapoirier/global-static-data-race-safety
enforce under strict concurrency that globals and statics be either…
This commit is contained in:
@@ -954,14 +954,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
if (Opts.isSwiftVersionAtLeast(6)) {
|
||||
Opts.StrictConcurrencyLevel = StrictConcurrency::Complete;
|
||||
} else if (const Arg *A = Args.getLastArg(OPT_strict_concurrency)) {
|
||||
auto value =
|
||||
llvm::StringSwitch<llvm::Optional<StrictConcurrency>>(A->getValue())
|
||||
.Case("minimal", StrictConcurrency::Minimal)
|
||||
.Case("targeted", StrictConcurrency::Targeted)
|
||||
.Case("complete", StrictConcurrency::Complete)
|
||||
.Default(llvm::None);
|
||||
|
||||
if (value)
|
||||
if (auto value = parseStrictConcurrency(A->getValue()))
|
||||
Opts.StrictConcurrencyLevel = *value;
|
||||
else
|
||||
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
|
||||
|
||||
Reference in New Issue
Block a user