1818#ifndef SWIFT_BASIC_LANGOPTIONS_H
1919#define SWIFT_BASIC_LANGOPTIONS_H
2020
21+ #include " swift/Basic/Feature.h"
2122#include " swift/Basic/FunctionBodySkipping.h"
2223#include " swift/Basic/LLVM.h"
2324#include " swift/Basic/Version.h"
2425#include " swift/Config.h"
2526#include " llvm/ADT/ArrayRef.h"
2627#include " llvm/ADT/Hashing.h"
2728#include " llvm/ADT/SmallString.h"
29+ #include " llvm/ADT/SmallSet.h"
2830#include " llvm/ADT/SmallVector.h"
2931#include " llvm/ADT/StringRef.h"
3032#include " llvm/ADT/Triple.h"
@@ -312,23 +314,13 @@ namespace swift {
312314 // / Specifies how strict concurrency checking will be.
313315 StrictConcurrency StrictConcurrencyLevel = StrictConcurrency::Targeted;
314316
315- // / Enable experimental #assert feature.
316- bool EnableExperimentalStaticAssert = false ;
317-
318317 // / Enable experimental concurrency model.
319318 bool EnableExperimentalConcurrency = false ;
320319
321- // / Enable experimental support for named opaque result types, e.g.
322- // / `func f() -> <T> T`.
323- bool EnableExperimentalNamedOpaqueTypes = false ;
324-
325320 // / Enable support for implicitly opening existential argument types
326321 // / in calls to generic functions.
327322 bool EnableOpenedExistentialTypes = false ;
328323
329- // / Enable experimental flow-sensitive concurrent captures.
330- bool EnableExperimentalFlowSensitiveConcurrentCaptures = false ;
331-
332324 // / Disable experimental ClangImporter diagnostics.
333325 bool DisableExperimentalClangImporterDiagnostics = false ;
334326
@@ -338,16 +330,6 @@ namespace swift {
338330 // / Enable inference of Sendable conformances for public types.
339331 bool EnableInferPublicSendable = false ;
340332
341- // / Enable experimental 'move only' features.
342- bool EnableExperimentalMoveOnly = false ;
343-
344- // / Enable variadic generics.
345- bool EnableExperimentalVariadicGenerics = false ;
346-
347- // / Enable experimental associated type inference using type witness
348- // / systems.
349- bool EnableExperimentalAssociatedTypeInference = false ;
350-
351333 // / Disable the implicit import of the _Concurrency module.
352334 bool DisableImplicitConcurrencyModuleImport =
353335 !SWIFT_IMPLICIT_CONCURRENCY_IMPORT;
@@ -369,6 +351,9 @@ namespace swift {
369351 // / behavior. This is a staging flag, and will be removed in the future.
370352 bool EnableNewOperatorLookup = false ;
371353
354+ // / The set of features that have been enabled.
355+ llvm::SmallSet<Feature, 2 > Features;
356+
372357 // / Use Clang function types for computing canonical types.
373358 // / If this option is false, the clang function types will still be computed
374359 // / but will not be used for checking type equality.
@@ -616,6 +601,13 @@ namespace swift {
616601 return EffectiveLanguageVersion.isVersionAtLeast (major, minor);
617602 }
618603
604+ // / Determine whether the given feature is enabled.
605+ bool hasFeature (Feature feature) const ;
606+
607+ // / Determine whether the given feature is enabled, looking up the feature
608+ // / by name.
609+ bool hasFeature (llvm::StringRef featureName) const ;
610+
619611 // / Returns true if the given platform condition argument represents
620612 // / a supported target operating system.
621613 // /
@@ -725,10 +717,6 @@ namespace swift {
725717 // / Disable constraint system performance hacks.
726718 bool DisableConstraintSolverPerformanceHacks = false ;
727719
728- // / Enable experimental support for one-way constraints for the
729- // / parameters of closures.
730- bool EnableOneWayClosureParameters = false ;
731-
732720 // / See \ref FrontendOptions.PrintFullConvention
733721 bool PrintFullConvention = false ;
734722 };
0 commit comments