Skip to content

Commit 5932ca4

Browse files
authored
Merge pull request #1623 from tbkka/tbkka-compiler-assertions
Pass through `-compiler-assertions` to the compiler
2 parents 06d4c79 + ae271ca commit 5932ca4

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
@@ -266,6 +266,9 @@ extension Driver {
266266
if isFrontendArgSupported(.noAllocations) {
267267
try commandLine.appendLast(.noAllocations, from: &parsedOptions)
268268
}
269+
if isFrontendArgSupported(.compilerAssertions) {
270+
try commandLine.appendLast(.compilerAssertions, from: &parsedOptions)
271+
}
269272
if isFrontendArgSupported(.enableExperimentalFeature) {
270273
try commandLine.appendAll(
271274
.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)