Skip to content

Commit 640c8d1

Browse files
committed
Deprecate the -warn-on-potentially-unavailable-enum-case option.
When `-warn-on-potentially-unavailable-enum-case` was introduced, the build system was required to invoke `swift-frontend` at artificially low deployment targets when emitting `.swiftinterface` files for legacy architectures. Because the deployment target was low, some availability diagnostics needed to be de-fanged in order to allow module interface emission to succeed. Today, the build system is able to use the correct deployment target when emitting module interfaces and the `-warn-on-potentially-unavailable-enum-case` is superfluous, so deprecate it. Resolves rdar://114092047
1 parent ed87628 commit 640c8d1

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@ extension Driver {
107107
commandLine.appendFlag("-aarch64-use-tbi")
108108
}
109109

110-
// Potentially unavailable enum cases are downgraded to a warning when building a
111-
// swiftmodule, to allow building a module (or module interface) for an older
112-
// deployment target than the framework itself.
113-
if isFrontendArgSupported(.warnOnPotentiallyUnavailableEnumCase) {
114-
if compilerOutputType == .swiftModule {
115-
commandLine.appendFlag(.warnOnPotentiallyUnavailableEnumCase)
116-
}
117-
}
118-
119110
// Enable or disable ObjC interop appropriately for the platform
120111
if targetTriple.isDarwin {
121112
commandLine.appendFlag(.enableObjcInterop)

Sources/SwiftOptions/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ extension Option {
789789
public static let warnLongFunctionBodiesEQ: Option = Option("-warn-long-function-bodies=", .joined, alias: Option.warnLongFunctionBodies, attributes: [.helpHidden, .frontend, .noDriver])
790790
public static let warnLongFunctionBodies: Option = Option("-warn-long-function-bodies", .separate, attributes: [.helpHidden, .frontend, .noDriver], metaVar: "<n>", helpText: "Warns when type-checking a function takes longer than <n> ms")
791791
public static let warnOnEditorPlaceholder: Option = Option("-warn-on-editor-placeholder", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Downgrade the editor placeholder error to a warning")
792-
public static let warnOnPotentiallyUnavailableEnumCase: Option = Option("-warn-on-potentially-unavailable-enum-case", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Downgrade potential unavailability of enum case to a warning")
792+
public static let warnOnPotentiallyUnavailableEnumCase: Option = Option("-warn-on-potentially-unavailable-enum-case", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Deprecated, has no effect")
793793
public static let warnRedundantRequirements: Option = Option("-warn-redundant-requirements", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Emit warnings for redundant requirements in generic signatures")
794794
public static let warnSwift3ObjcInferenceComplete: Option = Option("-warn-swift3-objc-inference-complete", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Warn about deprecated @objc inference in Swift 3 for every declaration that will no longer be inferred as @objc in Swift 4")
795795
public static let warnSwift3ObjcInferenceMinimal: Option = Option("-warn-swift3-objc-inference-minimal", .flag, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "Warn about deprecated @objc inference in Swift 3 based on direct uses of the Objective-C entrypoint")

0 commit comments

Comments
 (0)