AST/Sema: Look up custom availability domains by name.

Store the domain definitions defined on the command line on the `ModuleDecl` for
the main module.
This commit is contained in:
Allan Shortlidge
2025-01-30 16:29:29 -08:00
parent f9799aeba9
commit 770ddad742
6 changed files with 92 additions and 37 deletions

View File

@@ -4135,3 +4135,12 @@ version::Version ModuleDecl::getLanguageVersionBuiltWith() const {
return version::Version();
}
std::optional<AvailabilityDomain>
ModuleDecl::getAvailabilityDomainForIdentifier(Identifier identifier) const {
auto iter = AvailabilityDomains.find(identifier);
if (iter == AvailabilityDomains.end())
return std::nullopt;
return AvailabilityDomain::forCustom(iter->getSecond());
}