File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -3222,7 +3222,7 @@ class SemanticAvailableAttr final {
3222
3222
3223
3223
// / Returns the effective range in which the declaration with this attribute
3224
3224
// / was introduced.
3225
- AvailabilityRange getIntroducedRange (ASTContext &Ctx) const ;
3225
+ AvailabilityRange getIntroducedRange (const ASTContext &Ctx) const ;
3226
3226
3227
3227
// / The version tuple written in source for the `deprecated:` component.
3228
3228
std::optional<llvm::VersionTuple> getDeprecated () const {
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class AvailabilityDomain final {
88
88
89
89
// / Returns true if this domain is considered active in the current
90
90
// / compilation context.
91
- bool isActive (ASTContext &ctx) const ;
91
+ bool isActive (const ASTContext &ctx) const ;
92
92
93
93
// / Returns the string to use in diagnostics to identify the domain. May
94
94
// / return an empty string.
Original file line number Diff line number Diff line change @@ -828,10 +828,13 @@ bool AvailabilityInference::isAvailableAsSPI(const Decl *D) {
828
828
}
829
829
830
830
AvailabilityRange
831
- SemanticAvailableAttr::getIntroducedRange (ASTContext &Ctx) const {
832
- auto *attr = getParsedAttr ();
831
+ SemanticAvailableAttr::getIntroducedRange (const ASTContext &Ctx) const {
833
832
assert (domain.isActive (Ctx));
834
833
834
+ auto *attr = getParsedAttr ();
835
+ if (!attr->Introduced .has_value ())
836
+ return AvailabilityRange::alwaysAvailable ();
837
+
835
838
llvm::VersionTuple IntroducedVersion = attr->Introduced .value ();
836
839
StringRef Platform;
837
840
llvm::VersionTuple RemappedIntroducedVersion;
Original file line number Diff line number Diff line change 16
16
17
17
using namespace swift ;
18
18
19
- bool AvailabilityDomain::isActive (ASTContext &ctx) const {
19
+ bool AvailabilityDomain::isActive (const ASTContext &ctx) const {
20
20
switch (kind) {
21
21
case Kind::Universal:
22
22
case Kind::SwiftLanguage:
You can’t perform that action at this time.
0 commit comments