Skip to content

Commit

Permalink
Remove special handling of the -experimental-lazy-typecheck flag.
Browse files Browse the repository at this point in the history
For now, the flag will simply be a frontend flag and the build system will pass
it directly using `-Xfrontend` when appropriate.

Resolves rdar://117168788
  • Loading branch information
tshortli committed Oct 19, 2023
1 parent c5db212 commit abbf439
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ extension Driver {
case .indexFile:
compilerOutputType = .indexData

case .parse, .resolveImports, .typecheck, .experimentalLazyTypecheck,
case .parse, .resolveImports, .typecheck,
.dumpParse, .printAst, .dumpTypeRefinementContexts, .dumpScopeMaps,
.dumpInterfaceHash, .dumpTypeInfo, .verifyDebugInfo:
compilerOutputType = nil
Expand Down
5 changes: 0 additions & 5 deletions Sources/SwiftDriver/Jobs/EmitModuleJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ extension Driver {

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

if parsedOptions.hasArgument(.experimentalLazyTypecheck) {
commandLine.appendFlag("-experimental-lazy-typecheck")
commandLine.appendFlag("-experimental-skip-non-exportable-decls")
}

// Add the inputs.
for input in self.inputFiles where input.type.isPartOfSwiftCompilation {
commandLine.append(.path(input.file))
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ extension Option {
public static let driverExperimentalExplicitModuleBuild: Option = Option("-experimental-explicit-module-build", .flag, alias: Option.driverExplicitModuleBuild, attributes: [.helpHidden], helpText: "Prebuild module dependencies to make them explicit")
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")
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")
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)
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")
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")
public static let ExperimentalPerformanceAnnotations: Option = Option("-experimental-performance-annotations", .flag, attributes: [.helpHidden, .frontend], helpText: "Deprecated, has no effect")
public static let platformCCallingConventionEQ: Option = Option("-experimental-platform-c-calling-convention=", .joined, alias: Option.platformCCallingConvention, attributes: [.helpHidden, .frontend, .noDriver])
Expand Down
10 changes: 0 additions & 10 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7216,16 +7216,6 @@ final class SwiftDriverTests: XCTestCase {
]))
}
}

func testEmitModuleExperimentalLazyTypecheck() throws {
var driver = try Driver(args: [
"swiftc", "test.swift", "-module-name", "Test", "-experimental-lazy-typecheck", "-emit-module-interface"
])
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
let emitModuleJob = try XCTUnwrap(jobs.first(where: {$0.kind == .emitModule}))
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-skip-non-exportable-decls")))
}

func testEmitAPIDescriptorEmitModule() throws {
try withTemporaryDirectory { path in
Expand Down

0 comments on commit abbf439

Please sign in to comment.