AST: Adopt AvailabilityDomain in unavailability diagnostics.

This commit is contained in:
Allan Shortlidge
2024-12-06 16:55:50 -08:00
parent 9b7764a298
commit 7cf5d4bca5
3 changed files with 60 additions and 54 deletions

View File

@@ -72,6 +72,8 @@ public:
return AvailabilityDomain(Kind::PackageDescription);
}
Kind getKind() const { return kind; }
bool isUniversal() const { return kind == Kind::Universal; }
bool isPlatform() const { return kind == Kind::Platform; }
@@ -86,6 +88,10 @@ public:
return platform;
}
/// Returns the string to use in diagnostics to identify the domain. May
/// return an empty string.
llvm::StringRef getNameForDiagnostics() const;
/// Returns the string to use when printing an `@available` attribute.
llvm::StringRef getNameForAttributePrinting() const;
};