2828// Option: either a reference to a language option in the form
2929// "langOpts.<option name>" or "true" to indicate that it's always
3030// enabled.
31+ //
32+ // Suppressible language features can be suppressed when printing
33+ // an interface without having to suppress the entire declaration they're
34+ // contained within. The declaration will be emitted multiple times,
35+ // each with a subset of the suppressible features. To avoid combinatoric
36+ // re-emission, we assume a linear history: later features in this file
37+ // imply the existence of earlier features. (This only needs to apply to
38+ // suppressible features.)
39+ //
3140// ===----------------------------------------------------------------------===//
3241
3342#ifndef LANGUAGE_FEATURE
3443# error define LANGUAGE_FEATURE before including Features.def
3544#endif
3645
46+ #ifndef SUPPRESSIBLE_LANGUAGE_FEATURE
47+ #define SUPPRESSIBLE_LANGUAGE_FEATURE (FeatureName, SENumber, Description, Option ) \
48+ LANGUAGE_FEATURE (FeatureName, SENumber, Description, Option)
49+ #endif
50+
3751LANGUAGE_FEATURE (StaticAssert, 0 , " #assert" , langOpts.EnableExperimentalStaticAssert)
3852LANGUAGE_FEATURE(AsyncAwait, 296 , " async/await" , true )
3953LANGUAGE_FEATURE(EffectfulProp, 310 , " Effectful properties" , true )
@@ -57,8 +71,9 @@ LANGUAGE_FEATURE(BuiltinCreateAsyncTaskInGroup, 0, "MainActor executor building
5771LANGUAGE_FEATURE(BuiltinMove, 0 , " Builtin.move()" , true )
5872LANGUAGE_FEATURE(BuiltinCopy, 0 , " Builtin.copy()" , true )
5973LANGUAGE_FEATURE(BuiltinStackAlloc, 0 , " Builtin.stackAlloc" , true )
60- LANGUAGE_FEATURE (SpecializeAttributeWithAvailability, 0 , " @_specialize attribute with availability" , true )
74+ SUPPRESSIBLE_LANGUAGE_FEATURE (SpecializeAttributeWithAvailability, 0 , " @_specialize attribute with availability" , true )
6175LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0 , " Builtin.assumeAlignment" , true )
62- LANGUAGE_FEATURE (UnsafeInheritExecutor, 0 , " @_unsafeInheritExecutor" , true )
76+ SUPPRESSIBLE_LANGUAGE_FEATURE (UnsafeInheritExecutor, 0 , " @_unsafeInheritExecutor" , true )
6377
78+ #undef SUPPRESSIBLE_LANGUAGE_FEATURE
6479#undef LANGUAGE_FEATURE
0 commit comments