Skip to content

Commit d963c8a

Browse files
Merge pull request #585 from varungandhi-apple/vg-main
Conditionally pass musttail checking flag to frontend.
2 parents d775615 + 0acbbbd commit d963c8a

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
@@ -499,6 +499,7 @@ extension Option {
499499
public static let silVerifyAll: Option = Option("-sil-verify-all", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Verify SIL after each transform")
500500
public static let silVerifyNone: Option = Option("-sil-verify-none", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Completely disable SIL verification")
501501
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")
502+
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.")
502503
public static let skipSynthesizedMembers: Option = Option("-skip-synthesized-members", .flag, attributes: [.noDriver], helpText: "Skip members inherited through classes or default implementations")
503504
public static let solverDisableShrink: Option = Option("-solver-disable-shrink", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Disable the shrink phase of expression type checking")
504505
public static let solverExpressionTimeThresholdEQ: Option = Option("-solver-expression-time-threshold=", .joined, attributes: [.helpHidden, .frontend, .noDriver])
@@ -1083,6 +1084,7 @@ extension Option {
10831084
Option.silVerifyAll,
10841085
Option.silVerifyNone,
10851086
Option.skipInheritedDocs,
1087+
Option.skipSwifttailccMusttailCheck,
10861088
Option.skipSynthesizedMembers,
10871089
Option.solverDisableShrink,
10881090
Option.solverExpressionTimeThresholdEQ,

0 commit comments

Comments
 (0)