Skip to content

Commit 6580e50

Browse files
committed
AST Verifier: Remove a usage of getExistentialTypeProtocols()
1 parent 497336c commit 6580e50

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,11 +1128,10 @@ class Verifier : public ASTWalker {
11281128
abort();
11291129
}
11301130

1131-
SmallVector<ProtocolDecl*, 1> protocols;
1132-
srcTy->getExistentialTypeProtocols(protocols);
1133-
1134-
if (protocols.size() != 1
1135-
|| !protocols[0]->isObjC()) {
1131+
auto layout = srcTy->getExistentialLayout();
1132+
if (layout.superclass ||
1133+
!layout.isObjC() ||
1134+
layout.getProtocols().size() != 1) {
11361135
Out << "ProtocolMetatypeToObject with non-ObjC-protocol metatype:\n";
11371136
E->print(Out);
11381137
Out << "\n";

0 commit comments

Comments
 (0)