Skip to content

Commit 3cc3031

Browse files
committed
Basic/AST: Define the CustomAvailability experimental feature.
1 parent 4fa8c55 commit 3cc3031

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

include/swift/Basic/Features.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true)
447447
/// calling context.
448448
EXPERIMENTAL_FEATURE(NonIsolatedAsyncInheritsIsolationFromContext, false)
449449

450+
/// Allow custom availability domains to be defined and referenced.
451+
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(CustomAvailability, true)
452+
450453
#undef EXPERIMENTAL_FEATURE_EXCLUDED_FROM_MODULE_INTERFACE
451454
#undef EXPERIMENTAL_FEATURE
452455
#undef UPCOMING_FEATURE

lib/AST/ASTPrinter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,6 +3239,14 @@ suppressingFeatureAddressableTypes(PrintOptions &options,
32393239
action();
32403240
}
32413241

3242+
static void
3243+
suppressingFeatureCustomAvailability(PrintOptions &options,
3244+
llvm::function_ref<void()> action) {
3245+
// FIXME: [availability] Save and restore a bit controlling whether
3246+
// @available attributes for custom domains are printed.
3247+
action();
3248+
}
3249+
32423250
/// Suppress the printing of a particular feature.
32433251
static void suppressingFeature(PrintOptions &options, Feature feature,
32443252
llvm::function_ref<void()> action) {

lib/AST/FeatureSet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ static bool usesFeatureCoroutineAccessors(Decl *decl) {
407407
}
408408
}
409409

410+
static bool usesFeatureCustomAvailability(Decl *decl) {
411+
// FIXME: [availability] Check whether @available attributes for custom
412+
// domains are attached to the decl.
413+
return false;
414+
}
415+
410416
// ----------------------------------------------------------------------------
411417
// MARK: - FeatureSet
412418
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)