Skip to content

Commit 34bde99

Browse files
committed
Add getSwift57Availability() with a future platform version
1 parent 1ffcaf4 commit 34bde99

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/swift/AST/ASTContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

lib/AST/Availability.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ AvailabilityContext ASTContext::getSwift56Availability() {
488488
}
489489
}
490490

491+
AvailabilityContext ASTContext::getSwift57Availability() {
492+
return getSwiftFutureAvailability();
493+
}
494+
491495
AvailabilityContext ASTContext::getSwiftFutureAvailability() {
492496
auto target = LangOpts.Target;
493497

@@ -516,6 +520,7 @@ ASTContext::getSwift5PlusAvailability(llvm::VersionTuple swiftVersion) {
516520
case 4: return getSwift54Availability();
517521
case 5: return getSwift55Availability();
518522
case 6: return getSwift56Availability();
523+
case 7: return getSwift57Availability();
519524
default: break;
520525
}
521526
}

0 commit comments

Comments
 (0)