mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user