Skip to content

Commit 59c6d37

Browse files
committed
Add -experimental-skip-non-exportable-decls to lazy typechecking emit module jobs.
Resolves rdar://115731361
1 parent 16c49b9 commit 59c6d37

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
@@ -84,6 +84,11 @@ extension Driver {
8484

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

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

104109
try commandLine.appendLast(.checkApiAvailabilityOnly, from: &parsedOptions)
105-
if isFrontendArgSupported(.experimentalLazyTypecheck) {
106-
try commandLine.appendLast(.experimentalLazyTypecheck, from: &parsedOptions)
107-
}
108110

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

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7266,12 +7266,10 @@ final class SwiftDriverTests: XCTestCase {
72667266
var driver = try Driver(args: [
72677267
"swiftc", "test.swift", "-module-name", "Test", "-experimental-lazy-typecheck", "-emit-module-interface"
72687268
])
7269-
guard driver.isFrontendArgSupported(.experimentalLazyTypecheck) else {
7270-
throw XCTSkip("Skipping: compiler does not support '-experimental-lazy-typecheck'")
7271-
}
72727269
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
72737270
let emitModuleJob = try XCTUnwrap(jobs.first(where: {$0.kind == .emitModule}))
72747271
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
7272+
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-skip-non-exportable-decls")))
72757273
}
72767274
}
72777275

0 commit comments

Comments
 (0)