@@ -31,7 +31,8 @@ struct ExistentialLayout {
3131
3232 ExistentialLayout () {
3333 hasExplicitAnyObject = false ;
34- containsNonObjCProtocol = false ;
34+ containsObjCProtocol = false ;
35+ containsSwiftProtocol = false ;
3536 containsParameterized = false ;
3637 representsAnyObject = false ;
3738 }
@@ -46,8 +47,11 @@ struct ExistentialLayout {
4647 // / Whether the existential contains an explicit '& AnyObject' constraint.
4748 bool hasExplicitAnyObject : 1 ;
4849
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 ;
5155
5256 // / Whether any protocol members are parameterized.s
5357 bool containsParameterized : 1 ;
@@ -74,8 +78,8 @@ struct ExistentialLayout {
7478 // FIXME: Does the superclass have to be @objc?
7579 return ((explicitSuperclass ||
7680 hasExplicitAnyObject ||
77- ! getProtocols (). empty () ) &&
78- !containsNonObjCProtocol );
81+ containsObjCProtocol ) &&
82+ !containsSwiftProtocol );
7983 }
8084
8185 // / Whether the existential requires a class, either via an explicit
@@ -109,10 +113,6 @@ struct ExistentialLayout {
109113 // / Zero or more primary associated type requirements from a
110114 // / ParameterizedProtocolType
111115 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);
116116};
117117
118118}
0 commit comments