@@ -3189,13 +3189,44 @@ class SemanticAvailableAttr final {
3189
3189
const AvailableAttr *getParsedAttr () const { return attr; }
3190
3190
const AvailabilityDomain getDomain () const { return domain; }
3191
3191
3192
+ std::optional<llvm::VersionTuple> getIntroduced () const {
3193
+ return attr->Introduced ;
3194
+ }
3195
+
3196
+ std::optional<llvm::VersionTuple> getDeprecated () const {
3197
+ return attr->Deprecated ;
3198
+ }
3199
+
3200
+ std::optional<llvm::VersionTuple> getObsoleted () const {
3201
+ return attr->Obsoleted ;
3202
+ }
3203
+
3204
+ // / Returns the `message:` field of the attribute, or an empty string.
3205
+ StringRef getMessage () const { return attr->Message ; }
3206
+
3207
+ // / Returns the `rename:` field of the attribute, or an empty string.
3208
+ StringRef getRename () const { return attr->Rename ; }
3209
+
3192
3210
// / Returns the platform kind that the attribute applies to, or
3193
3211
// / `PlatformKind::none` if the attribute is not platform specific.
3194
- bool isPlatformSpecific () const { return domain .isPlatform (); }
3212
+ bool isPlatformSpecific () const { return getDomain () .isPlatform (); }
3195
3213
3196
3214
// / Returns the platform kind that the attribute applies to, or
3197
3215
// / `PlatformKind::none` if the attribute is not platform specific.
3198
- PlatformKind getPlatformKind () const { return domain.getPlatformKind (); }
3216
+ PlatformKind getPlatform () const { return getDomain ().getPlatformKind (); }
3217
+
3218
+ // / Whether this is attribute indicates unavailability in all versions.
3219
+ bool isUnconditionallyUnavailable () const {
3220
+ return attr->isUnconditionallyUnavailable ();
3221
+ }
3222
+
3223
+ // / Whether this is attribute indicates deprecation in all versions.
3224
+ bool isUnconditionallyDeprecated () const {
3225
+ return attr->isUnconditionallyDeprecated ();
3226
+ }
3227
+
3228
+ // / Whether this is a `noasync` attribute.
3229
+ bool isNoAsync () const { return attr->isNoAsync (); }
3199
3230
3200
3231
// / Whether this attribute has an introduced, deprecated, or obsoleted
3201
3232
// / version.
@@ -3205,14 +3236,17 @@ class SemanticAvailableAttr final {
3205
3236
3206
3237
// / Whether this is a language mode specific attribute.
3207
3238
bool isSwiftLanguageModeSpecific () const {
3208
- return domain .isSwiftLanguage () && isVersionSpecific ();
3239
+ return getDomain () .isSwiftLanguage () && isVersionSpecific ();
3209
3240
}
3210
3241
3211
3242
// / Whether this is a PackageDescription version specific attribute.
3212
3243
bool isPackageDescriptionVersionSpecific () const {
3213
- return domain .isPackageDescription () && isVersionSpecific ();
3244
+ return getDomain () .isPackageDescription () && isVersionSpecific ();
3214
3245
}
3215
3246
3247
+ // / Whether this attribute was spelled `@_unavailableInEmbedded`.
3248
+ bool isEmbeddedSpecific () const { return attr->isForEmbedded (); }
3249
+
3216
3250
// / Returns the active version from the AST context corresponding to
3217
3251
// / the available kind. For example, this will return the effective language
3218
3252
// / version for swift version-specific availability kind, PackageDescription
@@ -3228,6 +3262,14 @@ class SemanticAvailableAttr final {
3228
3262
// / Returns true if this attribute is considered active in the current
3229
3263
// / compilation context.
3230
3264
bool isActive (ASTContext &ctx) const ;
3265
+
3266
+ bool operator ==(const SemanticAvailableAttr &other) const {
3267
+ return other.attr == attr;
3268
+ }
3269
+
3270
+ bool operator !=(const SemanticAvailableAttr &other) const {
3271
+ return other.attr != attr;
3272
+ }
3231
3273
};
3232
3274
3233
3275
// / An iterable range of `SemanticAvailableAttr`s.
0 commit comments