Skip to content

Commit 0acbbbd

Browse files
Conditionally pass musttail checking flag to frontend.
Matching Swift PR: swiftlang/swift#36805.
1 parent 45f913d commit 0acbbbd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ extension Driver {
224224
}
225225
}
226226

227+
if !parsedOptions.hasArgument(.skipSwifttailccMusttailCheck) {
228+
commandLine.appendFlag("-Xllvm")
229+
commandLine.appendFlag("-enable-swifttailcc-musttail-check")
230+
}
231+
227232
// Pass through any subsystem flags.
228233
try commandLine.appendAll(.Xllvm, from: &parsedOptions)
229234
try commandLine.appendAll(.Xcc, from: &parsedOptions)

Sources/SwiftOptions/Options.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ extension Option {
497497
public static let silVerifyAll: Option = Option("-sil-verify-all", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Verify SIL after each transform")
498498
public static let silVerifyNone: Option = Option("-sil-verify-none", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Completely disable SIL verification")
499499
public static let skipInheritedDocs: Option = Option("-skip-inherited-docs", .flag, attributes: [.helpHidden, .frontend, .noInteractive, .supplementaryOutput], helpText: "Skip emitting doc comments for members inherited through classes or default implementations")
500+
public static let skipSwifttailccMusttailCheck: Option = Option("-skip-swifttailcc-musttail-check", .flag, attributes: [.helpHidden, .doesNotAffectIncrementalBuild], helpText: "Skip additional LLVM verification that all tail calls from swifttailcc->swifttailcc are marked musttail.")
500501
public static let skipSynthesizedMembers: Option = Option("-skip-synthesized-members", .flag, attributes: [.noDriver], helpText: "Skip members inherited through classes or default implementations")
501502
public static let solverDisableShrink: Option = Option("-solver-disable-shrink", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable the shrink phase of expression type checking")
502503
public static let solverExpressionTimeThresholdEQ: Option = Option("-solver-expression-time-threshold=", .joined, attributes: [.helpHidden, .frontend, .noDriver])
@@ -1079,6 +1080,7 @@ extension Option {
10791080
Option.silVerifyAll,
10801081
Option.silVerifyNone,
10811082
Option.skipInheritedDocs,
1083+
Option.skipSwifttailccMusttailCheck,
10821084
Option.skipSynthesizedMembers,
10831085
Option.solverDisableShrink,
10841086
Option.solverExpressionTimeThresholdEQ,

0 commit comments

Comments
 (0)