Skip to content

Commit 244d37b

Browse files
committed
Add support for -enable-experimental-feature and -enable-future-feature.
1 parent b0ca843 commit 244d37b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ extension Driver {
204204
try commandLine.appendAll(.debugPrefixMap, .coveragePrefixMap, .filePrefixMap, from: &parsedOptions)
205205
try commandLine.appendAllArguments(.Xfrontend, from: &parsedOptions)
206206
try commandLine.appendLast(.warnConcurrency, from: &parsedOptions)
207+
try commandLine.appendAll(.enableExperimentalFeature, from: &parsedOptions)
208+
try commandLine.appendAll(.enableFutureFeature, from: &parsedOptions)
207209
try commandLine.appendAll(.moduleAlias, from: &parsedOptions)
208210
if isFrontendArgSupported(.enableBareSlashRegex) {
209211
try commandLine.appendLast(.enableBareSlashRegex, from: &parsedOptions)

Sources/SwiftOptions/Options.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ extension Option {
298298
public static let enableExperimentalCxxInterop: Option = Option("-enable-experimental-cxx-interop", .flag, helpText: "Allow importing C++ modules into Swift (experimental feature)")
299299
public static let enableExperimentalDistributed: Option = Option("-enable-experimental-distributed", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental 'distributed' actors and functions")
300300
public static let enableExperimentalEagerClangModuleDiagnostics: Option = Option("-enable-experimental-eager-clang-module-diagnostics", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental eager diagnostics reporting on the importability of all referenced C, C++, and Objective-C libraries")
301+
public static let enableExperimentalFeature: Option = Option("-enable-experimental-feature", .separate, attributes: [.frontend], helpText: "Enable an experimental feature")
301302
public static let enableExperimentalFlowSensitiveConcurrentCaptures: Option = Option("-enable-experimental-flow-sensitive-concurrent-captures", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable flow-sensitive concurrent captures")
302303
public static let enableExperimentalForwardModeDifferentiation: Option = Option("-enable-experimental-forward-mode-differentiation", .flag, attributes: [.frontend], helpText: "Enable experimental forward mode differentiation")
303304
public static let enableExperimentalMoveOnly: Option = Option("-enable-experimental-move-only", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable experimental move only")
@@ -307,6 +308,7 @@ extension Option {
307308
public static let enableExperimentalStaticAssert: Option = Option("-enable-experimental-static-assert", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental #assert")
308309
public static let enableExperimentalStringProcessing: Option = Option("-enable-experimental-string-processing", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental string processing")
309310
public static let experimentalTypeInferenceFromDefaults: Option = Option("-enable-experimental-type-inference-from-defaults", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for generic parameter inference from default values")
311+
public static let enableFutureFeature: Option = Option("-enable-future-feature", .separate, attributes: [.frontend], helpText: "Enable a feature that will be introduced in a future language version")
310312
public static let enableExperimentalVariadicGenerics: Option = Option("-enable-experimental-variadic-generics", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for variadic generic types")
311313
public static let enableExplicitExistentialTypes: Option = Option("-enable-explicit-existential-types", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable experimental support for explicit existential types")
312314
public static let enableImplicitDynamic: Option = Option("-enable-implicit-dynamic", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Add 'dynamic' to all declarations")
@@ -969,6 +971,7 @@ extension Option {
969971
Option.enableExperimentalCxxInterop,
970972
Option.enableExperimentalDistributed,
971973
Option.enableExperimentalEagerClangModuleDiagnostics,
974+
Option.enableExperimentalFeature,
972975
Option.enableExperimentalFlowSensitiveConcurrentCaptures,
973976
Option.enableExperimentalForwardModeDifferentiation,
974977
Option.enableExperimentalMoveOnly,
@@ -978,6 +981,7 @@ extension Option {
978981
Option.enableExperimentalStaticAssert,
979982
Option.enableExperimentalStringProcessing,
980983
Option.experimentalTypeInferenceFromDefaults,
984+
Option.enableFutureFeature,
981985
Option.enableExperimentalVariadicGenerics,
982986
Option.enableExplicitExistentialTypes,
983987
Option.enableImplicitDynamic,

0 commit comments

Comments
 (0)