Skip to content

Commit 16328e0

Browse files
committed
Avoid passing -experimental-lazy-typecheck to compile jobs.
The `-experimental-lazy-typecheck` driver option was eroneously declared with `group: .modes` which caused the mode to be treated as a primary action for compile jobs. The flag should only be passed to emit module jobs, though. Resolves rdar://117168788
1 parent f16a26a commit 16328e0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/SwiftOptions/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ extension Option {
439439
public static let driverExperimentalExplicitModuleBuild: Option = Option("-experimental-explicit-module-build", .flag, alias: Option.driverExplicitModuleBuild, attributes: [.helpHidden], helpText: "Prebuild module dependencies to make them explicit")
440440
public static let forceWorkaroundBrokenModules: Option = Option("-experimental-force-workaround-broken-modules", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Attempt unsafe recovery for imported modules with broken modularization")
441441
public static let experimentalHermeticSealAtLink: Option = Option("-experimental-hermetic-seal-at-link", .flag, attributes: [.helpHidden, .frontend], helpText: "Library code can assume that all clients are visible at linktime, and aggressively strip unused code")
442-
public static let experimentalLazyTypecheck: Option = Option("-experimental-lazy-typecheck", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Parse input file(s), then type-check lazily as needed to produce requested outputs", group: .modes)
442+
public static let experimentalLazyTypecheck: Option = Option("-experimental-lazy-typecheck", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .doesNotAffectIncrementalBuild], helpText: "Parse input file(s), then type-check lazily as needed to produce requested outputs")
443443
public static let experimentalOneWayClosureParams: Option = Option("-experimental-one-way-closure-params", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for one-way closure parameters")
444444
public static let ExperimentalPerformanceAnnotations: Option = Option("-experimental-performance-annotations", .flag, attributes: [.helpHidden, .frontend], helpText: "Deprecated, has no effect")
445445
public static let platformCCallingConventionEQ: Option = Option("-experimental-platform-c-calling-convention=", .joined, alias: Option.platformCCallingConvention, attributes: [.helpHidden, .frontend, .noDriver])

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7267,6 +7267,11 @@ final class SwiftDriverTests: XCTestCase {
72677267
"swiftc", "test.swift", "-module-name", "Test", "-experimental-lazy-typecheck", "-emit-module-interface"
72687268
])
72697269
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
7270+
7271+
let compileJob = try XCTUnwrap(jobs.first(where: {$0.kind == .compile}))
7272+
XCTAssertFalse(compileJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
7273+
XCTAssertFalse(compileJob.commandLine.contains(.flag("-experimental-skip-non-exportable-decls")))
7274+
72707275
let emitModuleJob = try XCTUnwrap(jobs.first(where: {$0.kind == .emitModule}))
72717276
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
72727277
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-skip-non-exportable-decls")))

0 commit comments

Comments
 (0)