@@ -31,7 +31,8 @@ struct ExistentialLayout {
31
31
32
32
ExistentialLayout () {
33
33
hasExplicitAnyObject = false ;
34
- containsNonObjCProtocol = false ;
34
+ containsObjCProtocol = false ;
35
+ containsSwiftProtocol = false ;
35
36
containsParameterized = false ;
36
37
representsAnyObject = false ;
37
38
}
@@ -46,8 +47,11 @@ struct ExistentialLayout {
46
47
// / Whether the existential contains an explicit '& AnyObject' constraint.
47
48
bool hasExplicitAnyObject : 1 ;
48
49
49
- // / Whether any protocol members are non-@objc.
50
- bool containsNonObjCProtocol : 1 ;
50
+ // / Whether any protocol members are @objc.
51
+ bool containsObjCProtocol : 1 ;
52
+
53
+ // / Whether any protocol members require a witness table.
54
+ bool containsSwiftProtocol : 1 ;
51
55
52
56
// / Whether any protocol members are parameterized.s
53
57
bool containsParameterized : 1 ;
@@ -74,8 +78,8 @@ struct ExistentialLayout {
74
78
// FIXME: Does the superclass have to be @objc?
75
79
return ((explicitSuperclass ||
76
80
hasExplicitAnyObject ||
77
- ! getProtocols (). empty () ) &&
78
- !containsNonObjCProtocol );
81
+ containsObjCProtocol ) &&
82
+ !containsSwiftProtocol );
79
83
}
80
84
81
85
// / Whether the existential requires a class, either via an explicit
@@ -109,10 +113,6 @@ struct ExistentialLayout {
109
113
// / Zero or more primary associated type requirements from a
110
114
// / ParameterizedProtocolType
111
115
ArrayRef<Type> sameTypeRequirements;
112
-
113
- // / Existentials allow a relaxed notion of \c ValueDecl::isObjC
114
- // / that includes `Sendable` protocol.
115
- static bool isObjCProtocol (ProtocolDecl *P);
116
116
};
117
117
118
118
}
0 commit comments