@@ -3625,41 +3625,71 @@ class SemanticAvailableAttr final {
3625
3625
// / The source range of the `introduced:` version component.
3626
3626
SourceRange getIntroducedSourceRange () const { return attr->IntroducedRange ; }
3627
3627
3628
- // / Returns the effective introduction range indicated by this attribute.
3629
- // / This may correspond to the version specified by the `introduced:`
3630
- // / component (remapped or canonicalized if necessary) or it may be "always"
3631
- // / for an attribute indicating availability in a version-less domain. Returns
3632
- // / `std::nullopt` if the attribute does not indicate introduction.
3628
+ // / See `getIntroducedDomainAndRange()`.
3633
3629
std::optional<AvailabilityRange>
3634
- getIntroducedRange (const ASTContext &Ctx) const ;
3630
+ getIntroducedRange (const ASTContext &ctx) const {
3631
+ if (auto domainAndRange = getIntroducedDomainAndRange (ctx))
3632
+ return domainAndRange->getRange ();
3633
+ return std::nullopt;
3634
+ }
3635
+
3636
+ // / Returns the effective introduction range indicated by this attribute,
3637
+ // / along with the domain that it applies to (which may be different than the
3638
+ // / domain which the attribute was written with if a remap is required). This
3639
+ // / may correspond to the version specified by the `introduced:` component
3640
+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3641
+ // / attribute indicating availability in a version-less domain. Returns
3642
+ // / `std::nullopt` if the attribute does not indicate introduction.
3643
+ std::optional<AvailabilityDomainAndRange>
3644
+ getIntroducedDomainAndRange (const ASTContext &ctx) const ;
3635
3645
3636
3646
// / The version tuple for the `deprecated:` component.
3637
3647
std::optional<llvm::VersionTuple> getDeprecated () const ;
3638
3648
3639
3649
// / The source range of the `deprecated:` version component.
3640
3650
SourceRange getDeprecatedSourceRange () const { return attr->DeprecatedRange ; }
3641
3651
3642
- // / Returns the effective deprecation range indicated by this attribute.
3643
- // / This may correspond to the version specified by the `deprecated:`
3644
- // / component (remapped or canonicalized if necessary) or it may be "always"
3645
- // / for an unconditional deprecation attribute. Returns `std::nullopt` if the
3646
- // / attribute does not indicate deprecation.
3652
+ // / See `getDeprecatedDomainAndRange()`.
3647
3653
std::optional<AvailabilityRange>
3648
- getDeprecatedRange (const ASTContext &Ctx) const ;
3654
+ getDeprecatedRange (const ASTContext &ctx) const {
3655
+ if (auto domainAndRange = getDeprecatedDomainAndRange (ctx))
3656
+ return domainAndRange->getRange ();
3657
+ return std::nullopt;
3658
+ }
3659
+
3660
+ // / Returns the effective deprecation range indicated by this attribute, along
3661
+ // / with the domain that it applies to (which may be different than the domain
3662
+ // / which the attribute was written with if a remap is required). This may
3663
+ // / correspond to the version specified by the `deprecated:` component
3664
+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3665
+ // / unconditional deprecation attribute. Returns `std::nullopt` if the
3666
+ // / attribute does not indicate deprecation.
3667
+ std::optional<AvailabilityDomainAndRange>
3668
+ getDeprecatedDomainAndRange (const ASTContext &ctx) const ;
3649
3669
3650
3670
// / The version tuple for the `obsoleted:` component.
3651
3671
std::optional<llvm::VersionTuple> getObsoleted () const ;
3652
3672
3653
3673
// / The source range of the `obsoleted:` version component.
3654
3674
SourceRange getObsoletedSourceRange () const { return attr->ObsoletedRange ; }
3655
3675
3656
- // / Returns the effective obsoletion range indicated by this attribute.
3657
- // / This always corresponds to the version specified by the `obsoleted:`
3658
- // / component (remapped or canonicalized if necessary). Returns `std::nullopt`
3659
- // / if the attribute does not indicate obsoletion (note that unavailability is
3660
- // / separate from obsoletion.
3676
+ // / See `getObsoletedDomainAndRange()`.
3661
3677
std::optional<AvailabilityRange>
3662
- getObsoletedRange (const ASTContext &Ctx) const ;
3678
+ getObsoletedRange (const ASTContext &ctx) const {
3679
+ if (auto domainAndRange = getObsoletedDomainAndRange (ctx))
3680
+ return domainAndRange->getRange ();
3681
+ return std::nullopt;
3682
+ }
3683
+
3684
+ // / Returns the effective obsoletion range indicated by this attribute, along
3685
+ // / with the domain that it applies to (which may be different than the domain
3686
+ // / which the attribute was written with if a remap is required). This always
3687
+ // / corresponds to the version specified by the `obsoleted:` component
3688
+ // / (remapped or canonicalized if necessary). Returns `std::nullopt` if the
3689
+ // / attribute does not indicate obsoletion (note that unavailability is
3690
+ // / separate from obsoletion.
3691
+ std::optional<AvailabilityDomainAndRange>
3692
+ getObsoletedDomainAndRange (const ASTContext &ctx) const ;
3663
3693
3664
3694
// / Returns the `message:` field of the attribute, or an empty string.
3665
3695
StringRef getMessage () const { return attr->Message ; }
0 commit comments