@@ -345,10 +345,10 @@ getRemappedDeprecatedObsoletedVersionForFallbackPlatform(
345
345
}
346
346
347
347
bool AvailabilityInference::updateIntroducedPlatformForFallback (
348
- const AvailableAttr * attr, const ASTContext &Ctx, llvm::StringRef &Platform ,
349
- llvm::VersionTuple &PlatformVer) {
350
- std::optional<llvm::VersionTuple> IntroducedVersion = attr-> Introduced ;
351
- if (attr-> getPlatform () == PlatformKind::iOS &&
348
+ const SemanticAvailableAttr & attr, const ASTContext &Ctx,
349
+ llvm::StringRef &Platform, llvm:: VersionTuple &PlatformVer) {
350
+ std::optional<llvm::VersionTuple> IntroducedVersion = attr. getIntroduced () ;
351
+ if (attr. getPlatform () == PlatformKind::iOS &&
352
352
IntroducedVersion.has_value () &&
353
353
isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
354
354
// We re-map the iOS introduced version to the corresponding visionOS version
@@ -365,10 +365,10 @@ bool AvailabilityInference::updateIntroducedPlatformForFallback(
365
365
}
366
366
367
367
bool AvailabilityInference::updateDeprecatedPlatformForFallback (
368
- const AvailableAttr * attr, const ASTContext &Ctx, llvm::StringRef &Platform ,
369
- llvm::VersionTuple &PlatformVer) {
370
- std::optional<llvm::VersionTuple> DeprecatedVersion = attr-> Deprecated ;
371
- if (attr-> getPlatform () == PlatformKind::iOS &&
368
+ const SemanticAvailableAttr & attr, const ASTContext &Ctx,
369
+ llvm::StringRef &Platform, llvm:: VersionTuple &PlatformVer) {
370
+ std::optional<llvm::VersionTuple> DeprecatedVersion = attr. getDeprecated () ;
371
+ if (attr. getPlatform () == PlatformKind::iOS &&
372
372
DeprecatedVersion.has_value () &&
373
373
isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
374
374
// We re-map the iOS deprecated version to the corresponding visionOS version
@@ -385,11 +385,10 @@ bool AvailabilityInference::updateDeprecatedPlatformForFallback(
385
385
}
386
386
387
387
bool AvailabilityInference::updateObsoletedPlatformForFallback (
388
- const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform,
389
- llvm::VersionTuple &PlatformVer) {
390
- std::optional<llvm::VersionTuple> ObsoletedVersion = attr->Obsoleted ;
391
- if (attr->getPlatform () == PlatformKind::iOS &&
392
- ObsoletedVersion.has_value () &&
388
+ const SemanticAvailableAttr &attr, const ASTContext &Ctx,
389
+ llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer) {
390
+ std::optional<llvm::VersionTuple> ObsoletedVersion = attr.getObsoleted ();
391
+ if (attr.getPlatform () == PlatformKind::iOS && ObsoletedVersion.has_value () &&
393
392
isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
394
393
// We re-map the iOS obsoleted version to the corresponding visionOS version
395
394
auto PotentiallyRemappedObsoletedVersion =
@@ -405,8 +404,9 @@ bool AvailabilityInference::updateObsoletedPlatformForFallback(
405
404
}
406
405
407
406
void AvailabilityInference::updatePlatformStringForFallback (
408
- const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform) {
409
- if (attr->getPlatform () == PlatformKind::iOS &&
407
+ const SemanticAvailableAttr &attr, const ASTContext &Ctx,
408
+ llvm::StringRef &Platform) {
409
+ if (attr.getPlatform () == PlatformKind::iOS &&
410
410
isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
411
411
Platform = swift::prettyPlatformString (PlatformKind::visionOS);
412
412
}
@@ -531,8 +531,7 @@ std::optional<SemanticAvailableAttr> Decl::getDeprecatedAttr() const {
531
531
StringRef deprecatedPlatform;
532
532
llvm::VersionTuple remappedDeprecatedVersion;
533
533
if (AvailabilityInference::updateDeprecatedPlatformForFallback (
534
- attr.getParsedAttr (), ctx, deprecatedPlatform,
535
- remappedDeprecatedVersion))
534
+ attr, ctx, deprecatedPlatform, remappedDeprecatedVersion))
536
535
deprecatedVersion = remappedDeprecatedVersion;
537
536
538
537
if (!deprecatedVersion.has_value ())
@@ -839,7 +838,7 @@ SemanticAvailableAttr::getIntroducedRange(const ASTContext &Ctx) const {
839
838
StringRef Platform;
840
839
llvm::VersionTuple RemappedIntroducedVersion;
841
840
if (AvailabilityInference::updateIntroducedPlatformForFallback (
842
- attr , Ctx, Platform, RemappedIntroducedVersion))
841
+ * this , Ctx, Platform, RemappedIntroducedVersion))
843
842
IntroducedVersion = RemappedIntroducedVersion;
844
843
845
844
return AvailabilityRange{VersionRange::allGTE (IntroducedVersion)};
0 commit comments