Skip to content

Commit 0a4ee42

Browse files
committed
[Job] Add isSwiftFrontend check for Job kinds.
SwiftPM uses this, and it's better to have the predicate here for when we add new job kinds.
1 parent 0d10e67 commit 0a4ee42

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Sources/SwiftDriver/Jobs/Job.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,21 @@ extension Job {
115115
}
116116
}
117117

118+
extension Job.Kind {
119+
/// Whether this job kind uses the Swift frontend.
120+
public var isSwiftFrontend: Bool {
121+
switch self {
122+
case .backend, .compile, .mergeModule, .emitModule, .generatePCH,
123+
.generatePCM, .interpret, .repl, .printTargetInfo,
124+
.versionRequest:
125+
return true
126+
127+
case .autolinkExtract, .generateDSYM, .help, .link, .verifyDebugInfo:
128+
return false
129+
}
130+
131+
}
132+
}
118133
// MARK: - Job.ArgTemplate + Codable
119134

120135
extension Job.ArgTemplate: Codable {

0 commit comments

Comments
 (0)