Skip to content

Commit 500e6f4

Browse files
authored
Merge pull request #1156 from artemcm/ExplicitPrecompileCallsForExplicitJobKind
Separate two kinds of emit-module jobs into different categories: source emit-module and explicit dependency interface build
2 parents 1f2f5e9 + 0c9b2f6 commit 500e6f4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sources/SwiftDriver/ExplicitModuleBuilds/ExplicitDependencyBuildPlanner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public typealias ExternalTargetModuleDetailsMap = [ModuleDependencyId: ExternalT
182182

183183
jobs.append(Job(
184184
moduleName: moduleId.moduleName,
185-
kind: .emitModule,
185+
kind: .compileModuleFromInterface,
186186
tool: try toolchain.resolvedTool(.swiftCompiler),
187187
commandLine: commandLine,
188188
inputs: inputs,

Sources/SwiftDriver/Jobs/Job.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public struct Job: Codable, Equatable, Hashable {
2828

2929
/// Generate a compiled Clang module.
3030
case generatePCM = "generate-pcm"
31+
case compileModuleFromInterface = "compile-module-from-interface"
3132
case dumpPCM = "dump-pcm"
3233
case interpret
3334
case repl
@@ -189,6 +190,9 @@ extension Job : CustomStringConvertible {
189190
case .emitModule:
190191
return "Emitting module for \(moduleName)"
191192

193+
case .compileModuleFromInterface:
194+
return "Compiling module interface for Swift module \(moduleName)"
195+
192196
case .generatePCH:
193197
return join("Compiling bridging header", displayInputs.first?.file.basename)
194198

@@ -259,7 +263,7 @@ extension Job.Kind {
259263
/// Whether this job kind uses the Swift frontend.
260264
public var isSwiftFrontend: Bool {
261265
switch self {
262-
case .backend, .compile, .mergeModule, .emitModule, .generatePCH,
266+
case .backend, .compile, .mergeModule, .emitModule, .compileModuleFromInterface, .generatePCH,
263267
.generatePCM, .dumpPCM, .interpret, .repl, .printTargetInfo,
264268
.versionRequest, .emitSupportedFeatures, .scanDependencies, .verifyModuleInterface:
265269
return true
@@ -275,7 +279,7 @@ extension Job.Kind {
275279
switch self {
276280
case .compile:
277281
return true
278-
case .backend, .mergeModule, .emitModule, .generatePCH,
282+
case .backend, .mergeModule, .emitModule, .generatePCH, .compileModuleFromInterface,
279283
.generatePCM, .dumpPCM, .interpret, .repl, .printTargetInfo,
280284
.versionRequest, .autolinkExtract, .generateDSYM,
281285
.help, .link, .verifyDebugInfo, .scanDependencies,

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ throws {
3939
let moduleInterfacePath =
4040
TypedVirtualPath(file: swiftModuleDetails.moduleInterfacePath!.path,
4141
type: .swiftInterface)
42-
XCTAssertEqual(job.kind, .emitModule)
42+
XCTAssertEqual(job.kind, .compileModuleFromInterface)
4343
XCTAssertTrue(job.inputs.contains(moduleInterfacePath))
4444
if let compiledCandidateList = swiftModuleDetails.compiledModuleCandidates {
4545
for compiledCandidate in compiledCandidateList {

0 commit comments

Comments
 (0)