File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -886,6 +886,10 @@ class ASTContext final {
886
886
// / compiler for the target platform.
887
887
AvailabilityContext getSwift56Availability ();
888
888
889
+ // / Get the runtime availability of features introduced in the Swift 5.7
890
+ // / compiler for the target platform.
891
+ AvailabilityContext getSwift57Availability ();
892
+
889
893
// Note: Update this function if you add a new getSwiftXYAvailability above.
890
894
// / Get the runtime availability for a particular version of Swift (5.0+).
891
895
AvailabilityContext
Original file line number Diff line number Diff line change @@ -472,6 +472,23 @@ AvailabilityContext ASTContext::getSwift55Availability() {
472
472
}
473
473
474
474
AvailabilityContext ASTContext::getSwift56Availability () {
475
+ auto target = LangOpts.Target ;
476
+
477
+ if (target.isMacOSX () ) {
478
+ return AvailabilityContext (
479
+ VersionRange::allGTE (llvm::VersionTuple (12 , 3 , 0 )));
480
+ } else if (target.isiOS ()) {
481
+ return AvailabilityContext (
482
+ VersionRange::allGTE (llvm::VersionTuple (15 , 4 , 0 )));
483
+ } else if (target.isWatchOS ()) {
484
+ return AvailabilityContext (
485
+ VersionRange::allGTE (llvm::VersionTuple (8 , 5 , 0 )));
486
+ } else {
487
+ return AvailabilityContext::alwaysAvailable ();
488
+ }
489
+ }
490
+
491
+ AvailabilityContext ASTContext::getSwift57Availability () {
475
492
return getSwiftFutureAvailability ();
476
493
}
477
494
@@ -503,6 +520,7 @@ ASTContext::getSwift5PlusAvailability(llvm::VersionTuple swiftVersion) {
503
520
case 4 : return getSwift54Availability ();
504
521
case 5 : return getSwift55Availability ();
505
522
case 6 : return getSwift56Availability ();
523
+ case 7 : return getSwift57Availability ();
506
524
default : break ;
507
525
}
508
526
}
You can’t perform that action at this time.
0 commit comments