mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST/Sema: Resolve AvailabilityDomain in SemanticAvailableAttrRequest.
Look up the AvailabilityDomain given its name during type checking, instead of parsing.
This commit is contained in:
@@ -912,6 +912,12 @@ private:
|
||||
private:
|
||||
friend class SemanticAvailableAttrRequest;
|
||||
|
||||
void setCachedDomain(AvailabilityDomain domain) {
|
||||
assert(!Bits.AvailableAttr.HasDomain);
|
||||
Domain = domain;
|
||||
Bits.AvailableAttr.HasDomain = true;
|
||||
}
|
||||
|
||||
bool hasComputedSemanticAttr() const {
|
||||
return Bits.AvailableAttr.HasComputedSemanticAttr;
|
||||
}
|
||||
|
||||
@@ -140,6 +140,10 @@ public:
|
||||
return AvailabilityDomain(Kind::Embedded);
|
||||
}
|
||||
|
||||
/// Returns the built-in availability domain identified by the given string.
|
||||
static std::optional<AvailabilityDomain>
|
||||
builtinDomainForString(StringRef string);
|
||||
|
||||
Kind getKind() const {
|
||||
if (auto inlineDomain = getInlineDomain())
|
||||
return inlineDomain->getKind();
|
||||
|
||||
Reference in New Issue
Block a user