File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ using namespace swift;
2727CustomAvailabilityDomain::Kind
2828getCustomDomainKind (clang::FeatureAvailKind featureAvailKind) {
2929 switch (featureAvailKind) {
30- case clang::FeatureAvailKind::None:
31- llvm_unreachable (" unexpected kind" );
3230 case clang::FeatureAvailKind::Available:
3331 return CustomAvailabilityDomain::Kind::Enabled;
3432 case clang::FeatureAvailKind::Unavailable:
3533 return CustomAvailabilityDomain::Kind::Disabled;
3634 case clang::FeatureAvailKind::Dynamic:
3735 return CustomAvailabilityDomain::Kind::Dynamic;
36+ default :
37+ llvm::report_fatal_error (" unexpected kind" );
3838 }
3939}
4040
@@ -52,8 +52,15 @@ customDomainForClangDecl(ValueDecl *decl) {
5252 if (featureInfo.first .empty ())
5353 return nullptr ;
5454
55- if (featureInfo.second .Kind == clang::FeatureAvailKind::None)
55+ // Check that the domain has a supported availability kind.
56+ switch (featureInfo.second .Kind ) {
57+ case clang::FeatureAvailKind::Available:
58+ case clang::FeatureAvailKind::Unavailable:
59+ case clang::FeatureAvailKind::Dynamic:
60+ break ;
61+ default :
5662 return nullptr ;
63+ }
5764
5865 auto &ctx = decl->getASTContext ();
5966 FuncDecl *predicate = nullptr ;
You can’t perform that action at this time.
0 commit comments