@@ -40,7 +40,7 @@ static bool constrainRange(AvailabilityRange &existing,
40
40
41
41
bool AvailabilityContext::Info::constrainWith (const Info &other) {
42
42
bool isConstrained = false ;
43
- isConstrained |= constrainRange (Range , other.Range );
43
+ isConstrained |= constrainRange (PlatformRange , other.PlatformRange );
44
44
isConstrained |= constrainUnavailability (other.UnavailableDomains );
45
45
isConstrained |= CONSTRAIN_BOOL (IsDeprecated, other.IsDeprecated );
46
46
@@ -64,7 +64,8 @@ bool AvailabilityContext::Info::constrainWith(
64
64
// FIXME: [availability] Support versioning for other kinds of domains.
65
65
DEBUG_ASSERT (domain.isPlatform ());
66
66
if (domain.isPlatform ())
67
- isConstrained |= constrainRange (Range, attr.getIntroducedRange (ctx));
67
+ isConstrained |=
68
+ constrainRange (PlatformRange, attr.getIntroducedRange (ctx));
68
69
break ;
69
70
}
70
71
}
@@ -121,7 +122,7 @@ bool AvailabilityContext::Info::constrainUnavailability(
121
122
122
123
bool AvailabilityContext::Info::isContainedIn (const Info &other) const {
123
124
// The available versions range be the same or smaller.
124
- if (!Range .isContainedIn (other.Range ))
125
+ if (!PlatformRange .isContainedIn (other.PlatformRange ))
125
126
return false ;
126
127
127
128
// Every unavailable domain in the other context should be contained in some
@@ -147,7 +148,7 @@ bool AvailabilityContext::Info::isContainedIn(const Info &other) const {
147
148
}
148
149
149
150
void AvailabilityContext::Info::Profile (llvm::FoldingSetNodeID &ID) const {
150
- Range .getRawVersionRange ().Profile (ID);
151
+ PlatformRange .getRawVersionRange ().Profile (ID);
151
152
ID.AddInteger (UnavailableDomains.size ());
152
153
for (auto domain : UnavailableDomains) {
153
154
domain.Profile (ID);
@@ -186,7 +187,8 @@ AvailabilityContext::forDeploymentTarget(const ASTContext &ctx) {
186
187
}
187
188
188
189
AvailabilityRange AvailabilityContext::getPlatformRange () const {
189
- return storage->info .Range ;
190
+ return storage->info .PlatformRange ;
191
+ }
190
192
}
191
193
192
194
bool AvailabilityContext::isUnavailable () const {
@@ -223,7 +225,7 @@ void AvailabilityContext::constrainWithPlatformRange(
223
225
const AvailabilityRange &platformRange, const ASTContext &ctx) {
224
226
225
227
Info info{storage->info };
226
- if (!constrainRange (info.Range , platformRange))
228
+ if (!constrainRange (info.PlatformRange , platformRange))
227
229
return ;
228
230
229
231
storage = Storage::get (info, ctx);
@@ -253,7 +255,7 @@ void AvailabilityContext::constrainWithDeclAndPlatformRange(
253
255
swift::getAvailabilityConstraintsForDecl (decl, *this , flags);
254
256
isConstrained |= info.constrainWith (constraints, decl->getASTContext ());
255
257
isConstrained |= CONSTRAIN_BOOL (info.IsDeprecated , decl->isDeprecated ());
256
- isConstrained |= constrainRange (info.Range , platformRange);
258
+ isConstrained |= constrainRange (info.PlatformRange , platformRange);
257
259
258
260
if (!isConstrained)
259
261
return ;
0 commit comments