Skip to content

Commit ca949df

Browse files
authored
Merge pull request #1064 from DougGregor/update-options-and-strict-concurrency
Add and propagate `-strict-concurrency=...` flag
2 parents fb3d913 + af18894 commit ca949df

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ extension Driver {
209209
if isFrontendArgSupported(.enableBareSlashRegex) {
210210
try commandLine.appendLast(.enableBareSlashRegex, from: &parsedOptions)
211211
}
212+
if isFrontendArgSupported(.strictConcurrency) {
213+
try commandLine.appendLast(.strictConcurrency, from: &parsedOptions)
214+
}
212215

213216
// Expand the -experimental-hermetic-seal-at-link flag
214217
if parsedOptions.hasArgument(.experimentalHermeticSealAtLink) {

Sources/SwiftOptions/Options.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ extension Option {
586586
public static let staticStdlib: Option = Option("-static-stdlib", .flag, attributes: [.doesNotAffectIncrementalBuild], helpText: "Statically link the Swift standard library")
587587
public static let `static`: Option = Option("-static", .flag, attributes: [.frontend, .noInteractive, .moduleInterface], helpText: "Make this module statically linkable and make the output of -emit-library a static library.")
588588
public static let statsOutputDir: Option = Option("-stats-output-dir", .separate, attributes: [.helpHidden, .frontend, .argumentIsPath], helpText: "Directory to write unified compilation-statistics files to")
589+
public static let strictConcurrency: Option = Option("-strict-concurrency=", .joined, attributes: [.frontend], helpText: "Specify the how strict concurrency checking will be. The value may be 'off' (most 'Sendable' checking is disabled), 'limited' ('Sendable' checking is enabled in code that uses the concurrency model, or 'on' ('Sendable' and other checking is enabled for all code in the module)")
589590
public static let supplementaryOutputFileMap: Option = Option("-supplementary-output-file-map", .separate, attributes: [.frontend, .noDriver], helpText: "Specify supplementary outputs in a file rather than on the command line")
590591
public static let suppressStaticExclusivitySwap: Option = Option("-suppress-static-exclusivity-swap", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Suppress static violations of exclusive access with swap()")
591592
public static let suppressWarnings: Option = Option("-suppress-warnings", .flag, attributes: [.frontend], helpText: "Suppress all warnings")
@@ -1254,6 +1255,7 @@ extension Option {
12541255
Option.staticStdlib,
12551256
Option.`static`,
12561257
Option.statsOutputDir,
1258+
Option.strictConcurrency,
12571259
Option.supplementaryOutputFileMap,
12581260
Option.suppressStaticExclusivitySwap,
12591261
Option.suppressWarnings,

0 commit comments

Comments
 (0)