28
28
// Option: either a reference to a language option in the form
29
29
// "langOpts.<option name>" or "true" to indicate that it's always
30
30
// 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
+ //
31
40
// ===----------------------------------------------------------------------===//
32
41
33
42
#ifndef LANGUAGE_FEATURE
34
43
# error define LANGUAGE_FEATURE before including Features.def
35
44
#endif
36
45
46
+ #ifndef SUPPRESSIBLE_LANGUAGE_FEATURE
47
+ #define SUPPRESSIBLE_LANGUAGE_FEATURE (FeatureName, SENumber, Description, Option ) \
48
+ LANGUAGE_FEATURE (FeatureName, SENumber, Description, Option)
49
+ #endif
50
+
37
51
LANGUAGE_FEATURE (StaticAssert, 0 , " #assert" , langOpts.EnableExperimentalStaticAssert)
38
52
LANGUAGE_FEATURE(AsyncAwait, 296 , " async/await" , true )
39
53
LANGUAGE_FEATURE(EffectfulProp, 310 , " Effectful properties" , true )
@@ -57,8 +71,9 @@ LANGUAGE_FEATURE(BuiltinCreateAsyncTaskInGroup, 0, "MainActor executor building
57
71
LANGUAGE_FEATURE(BuiltinMove, 0 , " Builtin.move()" , true )
58
72
LANGUAGE_FEATURE(BuiltinCopy, 0 , " Builtin.copy()" , true )
59
73
LANGUAGE_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 )
61
75
LANGUAGE_FEATURE(BuiltinAssumeAlignment, 0 , " Builtin.assumeAlignment" , true )
62
- LANGUAGE_FEATURE (UnsafeInheritExecutor, 0 , " @_unsafeInheritExecutor" , true )
76
+ SUPPRESSIBLE_LANGUAGE_FEATURE (UnsafeInheritExecutor, 0 , " @_unsafeInheritExecutor" , true )
63
77
78
+ #undef SUPPRESSIBLE_LANGUAGE_FEATURE
64
79
#undef LANGUAGE_FEATURE
0 commit comments