Skip to content

Separate two kinds of emit-module jobs into different categories: source emit-module and explicit dependency interface build #1156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT

jobs.append(Job(
moduleName: moduleId.moduleName,
kind: .emitModule,
kind: .compileModuleFromInterface,
tool: try toolchain.resolvedTool(.swiftCompiler),
commandLine: commandLine,
inputs: inputs,
Expand Down
8 changes: 6 additions & 2 deletions Sources/SwiftDriver/Jobs/Job.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public struct Job: Codable, Equatable, Hashable {

/// Generate a compiled Clang module.
case generatePCM = "generate-pcm"
case compileModuleFromInterface = "compile-module-from-interface"
case dumpPCM = "dump-pcm"
case interpret
case repl
Expand Down Expand Up @@ -189,6 +190,9 @@ extension Job : CustomStringConvertible {
case .emitModule:
return "Emitting module for \(moduleName)"

case .compileModuleFromInterface:
return "Compiling module interface for Swift module \(moduleName)"

case .generatePCH:
return join("Compiling bridging header", displayInputs.first?.file.basename)

Expand Down Expand Up @@ -259,7 +263,7 @@ extension Job.Kind {
/// Whether this job kind uses the Swift frontend.
public var isSwiftFrontend: Bool {
switch self {
case .backend, .compile, .mergeModule, .emitModule, .generatePCH,
case .backend, .compile, .mergeModule, .emitModule, .compileModuleFromInterface, .generatePCH,
.generatePCM, .dumpPCM, .interpret, .repl, .printTargetInfo,
.versionRequest, .emitSupportedFeatures, .scanDependencies, .verifyModuleInterface:
return true
Expand All @@ -275,7 +279,7 @@ extension Job.Kind {
switch self {
case .compile:
return true
case .backend, .mergeModule, .emitModule, .generatePCH,
case .backend, .mergeModule, .emitModule, .generatePCH, .compileModuleFromInterface,
.generatePCM, .dumpPCM, .interpret, .repl, .printTargetInfo,
.versionRequest, .autolinkExtract, .generateDSYM,
.help, .link, .verifyDebugInfo, .scanDependencies,
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ throws {
let moduleInterfacePath =
TypedVirtualPath(file: swiftModuleDetails.moduleInterfacePath!.path,
type: .swiftInterface)
XCTAssertEqual(job.kind, .emitModule)
XCTAssertEqual(job.kind, .compileModuleFromInterface)
XCTAssertTrue(job.inputs.contains(moduleInterfacePath))
if let compiledCandidateList = swiftModuleDetails.compiledModuleCandidates {
for compiledCandidate in compiledCandidateList {
Expand Down