File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,9 @@ public struct Driver {
336
336
/// A global queue for emitting non-interrupted messages into stderr
337
337
public static let stdErrQueue = DispatchQueue ( label: " org.swift.driver.emit-to-stderr " )
338
338
339
+ enum KnownCompilerFeature : String {
340
+ case emit_abi_descriptor = " emit-abi-descriptor "
341
+ }
339
342
340
343
lazy var sdkPath : VirtualPath ? = {
341
344
guard let rawSdkPath = frontendTargetInfo. sdkPath? . path else {
@@ -367,6 +370,10 @@ public struct Driver {
367
370
}
368
371
}
369
372
373
+ func isFeatureSupported( _ feature: KnownCompilerFeature ) -> Bool {
374
+ return supportedFrontendFeatures. contains ( feature. rawValue)
375
+ }
376
+
370
377
/// Handler for emitting diagnostics to stderr.
371
378
public static let stderrDiagnosticsHandler : DiagnosticsEngine . DiagnosticsHandler = { diagnostic in
372
379
stdErrQueue. sync {
Original file line number Diff line number Diff line change @@ -87,9 +87,13 @@ extension Driver {
87
87
commandLine. appendFlag ( . parseAsLibrary)
88
88
}
89
89
90
+ let outputPath = VirtualPath . lookup ( moduleOutputPath)
90
91
commandLine. appendFlag ( . o)
91
- commandLine. appendPath ( VirtualPath . lookup ( moduleOutputPath) )
92
-
92
+ commandLine. appendPath ( outputPath)
93
+ if isFeatureSupported ( . emit_abi_descriptor) {
94
+ commandLine. appendFlag ( . emitAbiDescriptorPath)
95
+ commandLine. appendPath ( outputPath. replacingExtension ( with: . jsonABIBaseline) )
96
+ }
93
97
return Job (
94
98
moduleName: moduleOutputInfo. name,
95
99
kind: . emitModule,
Original file line number Diff line number Diff line change @@ -72,9 +72,14 @@ extension Driver {
72
72
try commandLine. appendLast ( . disableIncrementalImports, from: & parsedOptions)
73
73
}
74
74
75
+ let outputPath = VirtualPath . lookup ( moduleOutputInfo. output!. outputPath)
75
76
commandLine. appendFlag ( . o)
76
- commandLine. appendPath ( VirtualPath . lookup ( moduleOutputInfo . output! . outputPath) )
77
+ commandLine. appendPath ( outputPath)
77
78
79
+ if isFeatureSupported ( . emit_abi_descriptor) {
80
+ commandLine. appendFlag ( . emitAbiDescriptorPath)
81
+ commandLine. appendPath ( outputPath. replacingExtension ( with: . jsonABIBaseline) )
82
+ }
78
83
return Job (
79
84
moduleName: moduleOutputInfo. name,
80
85
kind: . mergeModule,
You can’t perform that action at this time.
0 commit comments