@@ -2234,15 +2234,16 @@ AvailableAttr::AvailableAttr(
2234
2234
Message(Message), Rename(Rename), RenameDecl(RenameDecl),
2235
2235
INIT_VER_TUPLE(Introduced), IntroducedRange(IntroducedRange),
2236
2236
INIT_VER_TUPLE(Deprecated), DeprecatedRange(DeprecatedRange),
2237
- INIT_VER_TUPLE(Obsoleted), ObsoletedRange(ObsoletedRange),
2238
- PlatformAgnostic(PlatformAgnostic), Platform(Platform) {
2237
+ INIT_VER_TUPLE(Obsoleted), ObsoletedRange(ObsoletedRange) {
2238
+ Bits.AvailableAttr .Platform = static_cast <uint8_t >(Platform);
2239
+ Bits.AvailableAttr .PlatformAgnostic = static_cast <uint8_t >(PlatformAgnostic);
2239
2240
Bits.AvailableAttr .IsSPI = IsSPI;
2240
2241
2241
2242
if (IsForEmbedded) {
2242
2243
// FIXME: The IsForEmbedded bit should be removed when library availability
2243
2244
// conditions are implemented (rdar://138802876)
2244
2245
Bits.AvailableAttr .IsForEmbedded = true ;
2245
- assert (Platform == PlatformKind::none);
2246
+ assert (getPlatform () == PlatformKind::none);
2246
2247
}
2247
2248
}
2248
2249
@@ -2279,7 +2280,7 @@ AvailableAttr *AvailableAttr::createForAlternative(
2279
2280
}
2280
2281
2281
2282
bool AvailableAttr::isActivePlatform (const ASTContext &ctx) const {
2282
- return isPlatformActive (Platform , ctx.LangOpts );
2283
+ return isPlatformActive (getPlatform () , ctx.LangOpts );
2283
2284
}
2284
2285
2285
2286
bool BackDeployedAttr::isActivePlatform (const ASTContext &ctx,
@@ -2290,14 +2291,14 @@ bool BackDeployedAttr::isActivePlatform(const ASTContext &ctx,
2290
2291
AvailableAttr *AvailableAttr::clone (ASTContext &C, bool implicit) const {
2291
2292
return new (C) AvailableAttr (implicit ? SourceLoc () : AtLoc,
2292
2293
implicit ? SourceRange () : getRange (),
2293
- Platform , Message, Rename, RenameDecl,
2294
+ getPlatform () , Message, Rename, RenameDecl,
2294
2295
Introduced ? *Introduced : llvm::VersionTuple (),
2295
2296
implicit ? SourceRange () : IntroducedRange,
2296
2297
Deprecated ? *Deprecated : llvm::VersionTuple (),
2297
2298
implicit ? SourceRange () : DeprecatedRange,
2298
2299
Obsoleted ? *Obsoleted : llvm::VersionTuple (),
2299
2300
implicit ? SourceRange () : ObsoletedRange,
2300
- PlatformAgnostic ,
2301
+ getPlatformAgnosticAvailability () ,
2301
2302
implicit,
2302
2303
isSPI (),
2303
2304
isForEmbedded ());
@@ -2332,10 +2333,10 @@ OriginallyDefinedInAttr *OriginallyDefinedInAttr::clone(ASTContext &C,
2332
2333
}
2333
2334
2334
2335
bool AvailableAttr::isLanguageVersionSpecific () const {
2335
- if (PlatformAgnostic ==
2336
+ if (getPlatformAgnosticAvailability () ==
2336
2337
PlatformAgnosticAvailabilityKind::SwiftVersionSpecific)
2337
2338
{
2338
- assert (Platform == PlatformKind::none &&
2339
+ assert (getPlatform () == PlatformKind::none &&
2339
2340
(Introduced.has_value () ||
2340
2341
Deprecated.has_value () ||
2341
2342
Obsoleted.has_value ()));
@@ -2345,10 +2346,10 @@ bool AvailableAttr::isLanguageVersionSpecific() const {
2345
2346
}
2346
2347
2347
2348
bool AvailableAttr::isPackageDescriptionVersionSpecific () const {
2348
- if (PlatformAgnostic ==
2349
+ if (getPlatformAgnosticAvailability () ==
2349
2350
PlatformAgnosticAvailabilityKind::PackageDescriptionVersionSpecific)
2350
2351
{
2351
- assert (Platform == PlatformKind::none &&
2352
+ assert (getPlatform () == PlatformKind::none &&
2352
2353
(Introduced.has_value () ||
2353
2354
Deprecated.has_value () ||
2354
2355
Obsoleted.has_value ()));
@@ -2358,7 +2359,7 @@ bool AvailableAttr::isPackageDescriptionVersionSpecific() const {
2358
2359
}
2359
2360
2360
2361
bool AvailableAttr::isUnconditionallyUnavailable () const {
2361
- switch (PlatformAgnostic ) {
2362
+ switch (getPlatformAgnosticAvailability () ) {
2362
2363
case PlatformAgnosticAvailabilityKind::None:
2363
2364
case PlatformAgnosticAvailabilityKind::Deprecated:
2364
2365
case PlatformAgnosticAvailabilityKind::SwiftVersionSpecific:
@@ -2375,7 +2376,7 @@ bool AvailableAttr::isUnconditionallyUnavailable() const {
2375
2376
}
2376
2377
2377
2378
bool AvailableAttr::isUnconditionallyDeprecated () const {
2378
- switch (PlatformAgnostic ) {
2379
+ switch (getPlatformAgnosticAvailability () ) {
2379
2380
case PlatformAgnosticAvailabilityKind::None:
2380
2381
case PlatformAgnosticAvailabilityKind::Unavailable:
2381
2382
case PlatformAgnosticAvailabilityKind::UnavailableInSwift:
@@ -2392,7 +2393,8 @@ bool AvailableAttr::isUnconditionallyDeprecated() const {
2392
2393
}
2393
2394
2394
2395
bool AvailableAttr::isNoAsync () const {
2395
- return PlatformAgnostic == PlatformAgnosticAvailabilityKind::NoAsync;
2396
+ return getPlatformAgnosticAvailability () ==
2397
+ PlatformAgnosticAvailabilityKind::NoAsync;
2396
2398
}
2397
2399
2398
2400
llvm::VersionTuple AvailableAttr::getActiveVersion (const ASTContext &ctx) const {
0 commit comments