@@ -330,86 +330,86 @@ getRemappedDeprecatedObsoletedVersionForFallbackPlatform(
330330 return Mapping->mapDeprecatedObsoletedAvailabilityVersion (Version);
331331}
332332
333- bool AvailabilityInference::updateIntroducedPlatformForFallback (
334- const SemanticAvailableAttr &attr, const ASTContext &Ctx ,
335- llvm::StringRef &Platform , llvm::VersionTuple &PlatformVer ) {
336- std::optional<llvm::VersionTuple> IntroducedVersion = attr.getIntroduced ();
333+ bool AvailabilityInference::updateIntroducedAvailabilityDomainForFallback (
334+ const SemanticAvailableAttr &attr, const ASTContext &ctx ,
335+ AvailabilityDomain &domain , llvm::VersionTuple &platformVer ) {
336+ std::optional<llvm::VersionTuple> introducedVersion = attr.getIntroduced ();
337337 if (attr.getPlatform () == PlatformKind::iOS &&
338- IntroducedVersion .has_value () &&
339- isPlatformActive (PlatformKind::visionOS, Ctx .LangOpts )) {
338+ introducedVersion .has_value () &&
339+ isPlatformActive (PlatformKind::visionOS, ctx .LangOpts )) {
340340 // We re-map the iOS introduced version to the corresponding visionOS version
341- auto PotentiallyRemappedIntroducedVersion =
342- getRemappedIntroducedVersionForFallbackPlatform (Ctx ,
343- *IntroducedVersion );
344- if (PotentiallyRemappedIntroducedVersion .has_value ()) {
345- Platform = swift::prettyPlatformString (PlatformKind::visionOS);
346- PlatformVer = PotentiallyRemappedIntroducedVersion .value ();
341+ auto potentiallyRemappedIntroducedVersion =
342+ getRemappedIntroducedVersionForFallbackPlatform (ctx ,
343+ *introducedVersion );
344+ if (potentiallyRemappedIntroducedVersion .has_value ()) {
345+ domain = AvailabilityDomain::forPlatform (PlatformKind::visionOS);
346+ platformVer = potentiallyRemappedIntroducedVersion .value ();
347347 return true ;
348348 }
349349 }
350350 return false ;
351351}
352352
353- bool AvailabilityInference::updateDeprecatedPlatformForFallback (
354- const SemanticAvailableAttr &attr, const ASTContext &Ctx ,
355- llvm::StringRef &Platform , llvm::VersionTuple &PlatformVer ) {
356- std::optional<llvm::VersionTuple> DeprecatedVersion = attr.getDeprecated ();
353+ bool AvailabilityInference::updateDeprecatedAvailabilityDomainForFallback (
354+ const SemanticAvailableAttr &attr, const ASTContext &ctx ,
355+ AvailabilityDomain &domain , llvm::VersionTuple &platformVer ) {
356+ std::optional<llvm::VersionTuple> deprecatedVersion = attr.getDeprecated ();
357357 if (attr.getPlatform () == PlatformKind::iOS &&
358- DeprecatedVersion .has_value () &&
359- isPlatformActive (PlatformKind::visionOS, Ctx .LangOpts )) {
358+ deprecatedVersion .has_value () &&
359+ isPlatformActive (PlatformKind::visionOS, ctx .LangOpts )) {
360360 // We re-map the iOS deprecated version to the corresponding visionOS version
361- auto PotentiallyRemappedDeprecatedVersion =
361+ auto potentiallyRemappedDeprecatedVersion =
362362 getRemappedDeprecatedObsoletedVersionForFallbackPlatform (
363- Ctx , *DeprecatedVersion );
364- if (PotentiallyRemappedDeprecatedVersion .has_value ()) {
365- Platform = swift::prettyPlatformString (PlatformKind::visionOS);
366- PlatformVer = PotentiallyRemappedDeprecatedVersion .value ();
363+ ctx , *deprecatedVersion );
364+ if (potentiallyRemappedDeprecatedVersion .has_value ()) {
365+ domain = AvailabilityDomain::forPlatform (PlatformKind::visionOS);
366+ platformVer = potentiallyRemappedDeprecatedVersion .value ();
367367 return true ;
368368 }
369369 }
370370 return false ;
371371}
372372
373- bool AvailabilityInference::updateObsoletedPlatformForFallback (
374- const SemanticAvailableAttr &attr, const ASTContext &Ctx ,
375- llvm::StringRef &Platform , llvm::VersionTuple &PlatformVer ) {
376- std::optional<llvm::VersionTuple> ObsoletedVersion = attr.getObsoleted ();
377- if (attr.getPlatform () == PlatformKind::iOS && ObsoletedVersion .has_value () &&
378- isPlatformActive (PlatformKind::visionOS, Ctx .LangOpts )) {
373+ bool AvailabilityInference::updateObsoletedAvailabilityDomainForFallback (
374+ const SemanticAvailableAttr &attr, const ASTContext &ctx ,
375+ AvailabilityDomain &domain , llvm::VersionTuple &platformVer ) {
376+ std::optional<llvm::VersionTuple> obsoletedVersion = attr.getObsoleted ();
377+ if (attr.getPlatform () == PlatformKind::iOS && obsoletedVersion .has_value () &&
378+ isPlatformActive (PlatformKind::visionOS, ctx .LangOpts )) {
379379 // We re-map the iOS obsoleted version to the corresponding visionOS version
380- auto PotentiallyRemappedObsoletedVersion =
380+ auto potentiallyRemappedObsoletedVersion =
381381 getRemappedDeprecatedObsoletedVersionForFallbackPlatform (
382- Ctx , *ObsoletedVersion );
383- if (PotentiallyRemappedObsoletedVersion .has_value ()) {
384- Platform = swift::prettyPlatformString (PlatformKind::visionOS);
385- PlatformVer = PotentiallyRemappedObsoletedVersion .value ();
382+ ctx , *obsoletedVersion );
383+ if (potentiallyRemappedObsoletedVersion .has_value ()) {
384+ domain = AvailabilityDomain::forPlatform (PlatformKind::visionOS);
385+ platformVer = potentiallyRemappedObsoletedVersion .value ();
386386 return true ;
387387 }
388388 }
389389 return false ;
390390}
391391
392- void AvailabilityInference::updatePlatformStringForFallback (
392+ void AvailabilityInference::updateAvailabilityDomainForFallback (
393393 const SemanticAvailableAttr &attr, const ASTContext &Ctx,
394- llvm::StringRef &Platform ) {
394+ AvailabilityDomain &domain ) {
395395 if (attr.getPlatform () == PlatformKind::iOS &&
396396 isPlatformActive (PlatformKind::visionOS, Ctx.LangOpts )) {
397- Platform = swift::prettyPlatformString (PlatformKind::visionOS);
397+ domain = AvailabilityDomain::forPlatform (PlatformKind::visionOS);
398398 }
399399}
400400
401- bool AvailabilityInference::updateBeforePlatformForFallback (
402- const BackDeployedAttr *attr, const ASTContext &Ctx ,
403- llvm::StringRef &Platform , llvm::VersionTuple &PlatformVer ) {
404- auto BeforeVersion = attr->Version ;
401+ bool AvailabilityInference::updateBeforeAvailabilityDomainForFallback (
402+ const BackDeployedAttr *attr, const ASTContext &ctx ,
403+ AvailabilityDomain &domain , llvm::VersionTuple &platformVer ) {
404+ auto beforeVersion = attr->Version ;
405405 if (attr->Platform == PlatformKind::iOS &&
406- isPlatformActive (PlatformKind::visionOS, Ctx .LangOpts )) {
406+ isPlatformActive (PlatformKind::visionOS, ctx .LangOpts )) {
407407 // We re-map the iOS before version to the corresponding visionOS version
408408 auto PotentiallyRemappedIntroducedVersion =
409- getRemappedIntroducedVersionForFallbackPlatform (Ctx, BeforeVersion );
409+ getRemappedIntroducedVersionForFallbackPlatform (ctx, beforeVersion );
410410 if (PotentiallyRemappedIntroducedVersion.has_value ()) {
411- Platform = swift::prettyPlatformString (PlatformKind::visionOS);
412- PlatformVer = PotentiallyRemappedIntroducedVersion.value ();
411+ domain = AvailabilityDomain::forPlatform (PlatformKind::visionOS);
412+ platformVer = PotentiallyRemappedIntroducedVersion.value ();
413413 return true ;
414414 }
415415 }
@@ -492,10 +492,10 @@ std::optional<SemanticAvailableAttr> Decl::getDeprecatedAttr() const {
492492
493493 auto deprecatedVersion = attr.getDeprecated ();
494494
495- StringRef deprecatedPlatform ;
495+ AvailabilityDomain unusedDomain ;
496496 llvm::VersionTuple remappedDeprecatedVersion;
497- if (AvailabilityInference::updateDeprecatedPlatformForFallback (
498- attr, ctx, deprecatedPlatform , remappedDeprecatedVersion))
497+ if (AvailabilityInference::updateDeprecatedAvailabilityDomainForFallback (
498+ attr, ctx, unusedDomain , remappedDeprecatedVersion))
499499 deprecatedVersion = remappedDeprecatedVersion;
500500
501501 if (!deprecatedVersion.has_value ())
@@ -892,10 +892,10 @@ SemanticAvailableAttr::getIntroducedRange(const ASTContext &Ctx) const {
892892 return AvailabilityRange::alwaysAvailable ();
893893
894894 llvm::VersionTuple IntroducedVersion = getIntroduced ().value ();
895- StringRef Platform ;
895+ AvailabilityDomain UnusedDomain ;
896896 llvm::VersionTuple RemappedIntroducedVersion;
897- if (AvailabilityInference::updateIntroducedPlatformForFallback (
898- *this , Ctx, Platform , RemappedIntroducedVersion))
897+ if (AvailabilityInference::updateIntroducedAvailabilityDomainForFallback (
898+ *this , Ctx, UnusedDomain , RemappedIntroducedVersion))
899899 IntroducedVersion = RemappedIntroducedVersion;
900900
901901 return AvailabilityRange{VersionRange::allGTE (IntroducedVersion)};
0 commit comments