Skip to content

Commit 6166a95

Browse files
committed
Pass through -compiler-assertions to the compiler
1 parent 1e7ed77 commit 6166a95

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ extension Driver {
266266
if isFrontendArgSupported(.noAllocations) {
267267
try commandLine.appendLast(.noAllocations, from: &parsedOptions)
268268
}
269+
try commandLine.appendLast(.compilerAssertions, from: &parsedOptions)
269270
if isFrontendArgSupported(.enableExperimentalFeature) {
270271
try commandLine.appendAll(
271272
.enableExperimentalFeature, from: &parsedOptions)

Sources/SwiftOptions/Options.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ extension Option {
8686
public static let colorDiagnostics: Option = Option("-color-diagnostics", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Print diagnostics in color")
8787
public static let compareToBaselinePath: Option = Option("-compare-to-baseline-path", .separate, attributes: [.noInteractive, .argumentIsPath], metaVar: "<path>", helpText: "Compare the built module to the baseline at <path> and diagnose breaking changes using the API digester")
8888
public static let compileModuleFromInterface: Option = Option("-compile-module-from-interface", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Treat the (single) input as a swiftinterface and produce a module", group: .modes)
89+
public static let compilerAssertions: Option = Option("-compiler-assertions", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild, .cacheInvariant], helpText: "Enable internal self-checks while compiling", group: .internalDebug)
8990
public static let compilerStyleDiags: Option = Option("-compiler-style-diags", .flag, attributes: [.noDriver], helpText: "Print compiler style diagnostics to stderr.")
9091
public static let compilerStyleDiags_: Option = Option("--compiler-style-diags", .flag, alias: Option.compilerStyleDiags, attributes: [.noDriver], helpText: "Print compiler style diagnostics to stderr.")
9192
public static let concurrencyModelEQ: Option = Option("-concurrency-model=", .joined, alias: Option.concurrencyModel, attributes: [.helpHidden, .frontend, .noDriver])
@@ -942,6 +943,7 @@ extension Option {
942943
Option.colorDiagnostics,
943944
Option.compareToBaselinePath,
944945
Option.compileModuleFromInterface,
946+
Option.compilerAssertions,
945947
Option.compilerStyleDiags,
946948
Option.compilerStyleDiags_,
947949
Option.concurrencyModelEQ,

0 commit comments

Comments
 (0)