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 {
886886 // / compiler for the target platform.
887887 AvailabilityContext getSwift56Availability ();
888888
889+ // / Get the runtime availability of features introduced in the Swift 5.7
890+ // / compiler for the target platform.
891+ AvailabilityContext getSwift57Availability ();
892+
889893 // Note: Update this function if you add a new getSwiftXYAvailability above.
890894 // / Get the runtime availability for a particular version of Swift (5.0+).
891895 AvailabilityContext
Original file line number Diff line number Diff line change @@ -472,6 +472,23 @@ AvailabilityContext ASTContext::getSwift55Availability() {
472472}
473473
474474AvailabilityContext 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 () {
475492 return getSwiftFutureAvailability ();
476493}
477494
@@ -503,6 +520,7 @@ ASTContext::getSwift5PlusAvailability(llvm::VersionTuple swiftVersion) {
503520 case 4 : return getSwift54Availability ();
504521 case 5 : return getSwift55Availability ();
505522 case 6 : return getSwift56Availability ();
523+ case 7 : return getSwift57Availability ();
506524 default : break ;
507525 }
508526 }
You can’t perform that action at this time.
0 commit comments