@@ -3757,41 +3757,71 @@ class SemanticAvailableAttr final {
3757
3757
// / The source range of the `introduced:` version component.
3758
3758
SourceRange getIntroducedSourceRange () const { return attr->IntroducedRange ; }
3759
3759
3760
- // / Returns the effective introduction range indicated by this attribute.
3761
- // / This may correspond to the version specified by the `introduced:`
3762
- // / component (remapped or canonicalized if necessary) or it may be "always"
3763
- // / for an attribute indicating availability in a version-less domain. Returns
3764
- // / `std::nullopt` if the attribute does not indicate introduction.
3760
+ // / See `getIntroducedDomainAndRange()`.
3765
3761
std::optional<AvailabilityRange>
3766
- getIntroducedRange (const ASTContext &Ctx) const ;
3762
+ getIntroducedRange (const ASTContext &ctx) const {
3763
+ if (auto domainAndRange = getIntroducedDomainAndRange (ctx))
3764
+ return domainAndRange->getRange ();
3765
+ return std::nullopt;
3766
+ }
3767
+
3768
+ // / Returns the effective introduction range indicated by this attribute,
3769
+ // / along with the domain that it applies to (which may be different than the
3770
+ // / domain which the attribute was written with if a remap is required). This
3771
+ // / may correspond to the version specified by the `introduced:` component
3772
+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3773
+ // / attribute indicating availability in a version-less domain. Returns
3774
+ // / `std::nullopt` if the attribute does not indicate introduction.
3775
+ std::optional<AvailabilityDomainAndRange>
3776
+ getIntroducedDomainAndRange (const ASTContext &ctx) const ;
3767
3777
3768
3778
// / The version tuple for the `deprecated:` component.
3769
3779
std::optional<llvm::VersionTuple> getDeprecated () const ;
3770
3780
3771
3781
// / The source range of the `deprecated:` version component.
3772
3782
SourceRange getDeprecatedSourceRange () const { return attr->DeprecatedRange ; }
3773
3783
3774
- // / Returns the effective deprecation range indicated by this attribute.
3775
- // / This may correspond to the version specified by the `deprecated:`
3776
- // / component (remapped or canonicalized if necessary) or it may be "always"
3777
- // / for an unconditional deprecation attribute. Returns `std::nullopt` if the
3778
- // / attribute does not indicate deprecation.
3784
+ // / See `getDeprecatedDomainAndRange()`.
3779
3785
std::optional<AvailabilityRange>
3780
- getDeprecatedRange (const ASTContext &Ctx) const ;
3786
+ getDeprecatedRange (const ASTContext &ctx) const {
3787
+ if (auto domainAndRange = getDeprecatedDomainAndRange (ctx))
3788
+ return domainAndRange->getRange ();
3789
+ return std::nullopt;
3790
+ }
3791
+
3792
+ // / Returns the effective deprecation range indicated by this attribute, along
3793
+ // / with the domain that it applies to (which may be different than the domain
3794
+ // / which the attribute was written with if a remap is required). This may
3795
+ // / correspond to the version specified by the `deprecated:` component
3796
+ // / (remapped or canonicalized if necessary) or it may be "always" for an
3797
+ // / unconditional deprecation attribute. Returns `std::nullopt` if the
3798
+ // / attribute does not indicate deprecation.
3799
+ std::optional<AvailabilityDomainAndRange>
3800
+ getDeprecatedDomainAndRange (const ASTContext &ctx) const ;
3781
3801
3782
3802
// / The version tuple for the `obsoleted:` component.
3783
3803
std::optional<llvm::VersionTuple> getObsoleted () const ;
3784
3804
3785
3805
// / The source range of the `obsoleted:` version component.
3786
3806
SourceRange getObsoletedSourceRange () const { return attr->ObsoletedRange ; }
3787
3807
3788
- // / Returns the effective obsoletion range indicated by this attribute.
3789
- // / This always corresponds to the version specified by the `obsoleted:`
3790
- // / component (remapped or canonicalized if necessary). Returns `std::nullopt`
3791
- // / if the attribute does not indicate obsoletion (note that unavailability is
3792
- // / separate from obsoletion.
3808
+ // / See `getObsoletedDomainAndRange()`.
3793
3809
std::optional<AvailabilityRange>
3794
- getObsoletedRange (const ASTContext &Ctx) const ;
3810
+ getObsoletedRange (const ASTContext &ctx) const {
3811
+ if (auto domainAndRange = getObsoletedDomainAndRange (ctx))
3812
+ return domainAndRange->getRange ();
3813
+ return std::nullopt;
3814
+ }
3815
+
3816
+ // / Returns the effective obsoletion range indicated by this attribute, along
3817
+ // / with the domain that it applies to (which may be different than the domain
3818
+ // / which the attribute was written with if a remap is required). This always
3819
+ // / corresponds to the version specified by the `obsoleted:` component
3820
+ // / (remapped or canonicalized if necessary). Returns `std::nullopt` if the
3821
+ // / attribute does not indicate obsoletion (note that unavailability is
3822
+ // / separate from obsoletion.
3823
+ std::optional<AvailabilityDomainAndRange>
3824
+ getObsoletedDomainAndRange (const ASTContext &ctx) const ;
3795
3825
3796
3826
// / Returns the `message:` field of the attribute, or an empty string.
3797
3827
StringRef getMessage () const { return attr->Message ; }
0 commit comments