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;
27
27
CustomAvailabilityDomain::Kind
28
28
getCustomDomainKind (clang::FeatureAvailKind featureAvailKind) {
29
29
switch (featureAvailKind) {
30
- case clang::FeatureAvailKind::None:
31
- llvm_unreachable (" unexpected kind" );
32
30
case clang::FeatureAvailKind::Available:
33
31
return CustomAvailabilityDomain::Kind::Enabled;
34
32
case clang::FeatureAvailKind::Unavailable:
35
33
return CustomAvailabilityDomain::Kind::Disabled;
36
34
case clang::FeatureAvailKind::Dynamic:
37
35
return CustomAvailabilityDomain::Kind::Dynamic;
36
+ default :
37
+ llvm::report_fatal_error (" unexpected kind" );
38
38
}
39
39
}
40
40
@@ -52,8 +52,15 @@ customDomainForClangDecl(ValueDecl *decl) {
52
52
if (featureInfo.first .empty ())
53
53
return nullptr ;
54
54
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 :
56
62
return nullptr ;
63
+ }
57
64
58
65
auto &ctx = decl->getASTContext ();
59
66
FuncDecl *predicate = nullptr ;
You can’t perform that action at this time.
0 commit comments