Skip to content

Commit 750c639

Browse files
committed
Add -experimental-skip-non-exportable-decls to lazy typechecking emit module jobs.
Resolves rdar://115731361
1 parent 1ac2578 commit 750c639

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SwiftDriver/Jobs/EmitModuleJob.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ extension Driver {
8585

8686
commandLine.appendFlags("-frontend", "-emit-module", "-experimental-skip-non-inlinable-function-bodies-without-types")
8787

88+
if parsedOptions.hasArgument(.experimentalLazyTypecheck) {
89+
commandLine.appendFlag("-experimental-lazy-typecheck")
90+
commandLine.appendFlag("-experimental-skip-non-exportable-decls")
91+
}
92+
8893
// Add the inputs.
8994
for input in self.inputFiles where input.type.isPartOfSwiftCompilation {
9095
commandLine.append(.path(input.file))
@@ -103,9 +108,6 @@ extension Driver {
103108
try addCommonSymbolGraphOptions(commandLine: &commandLine)
104109

105110
try commandLine.appendLast(.checkApiAvailabilityOnly, from: &parsedOptions)
106-
if isFrontendArgSupported(.experimentalLazyTypecheck) {
107-
try commandLine.appendLast(.experimentalLazyTypecheck, from: &parsedOptions)
108-
}
109111

110112
if parsedOptions.hasArgument(.parseAsLibrary, .emitLibrary) {
111113
commandLine.appendFlag(.parseAsLibrary)

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7221,12 +7221,10 @@ final class SwiftDriverTests: XCTestCase {
72217221
var driver = try Driver(args: [
72227222
"swiftc", "test.swift", "-module-name", "Test", "-experimental-lazy-typecheck", "-emit-module-interface"
72237223
])
7224-
guard driver.isFrontendArgSupported(.experimentalLazyTypecheck) else {
7225-
throw XCTSkip("Skipping: compiler does not support '-experimental-lazy-typecheck'")
7226-
}
72277224
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
72287225
let emitModuleJob = try XCTUnwrap(jobs.first(where: {$0.kind == .emitModule}))
72297226
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
7227+
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-skip-non-exportable-decls")))
72307228
}
72317229

72327230
func testEmitAPIDescriptorEmitModule() throws {

0 commit comments

Comments
 (0)