Skip to content

Commit 2cd6a03

Browse files
committed
AST: Remove getExistentialTypeProtocols()
1 parent ea01582 commit 2cd6a03

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

include/swift/AST/Type.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ class CanType : public Type {
351351
static bool isReferenceTypeImpl(CanType type, bool functionsCount);
352352
static bool isExistentialTypeImpl(CanType type);
353353
static bool isAnyExistentialTypeImpl(CanType type);
354-
static void getExistentialTypeProtocolsImpl(CanType type,
355-
SmallVectorImpl<ProtocolDecl*> &protocols);
356354
static bool isObjCExistentialTypeImpl(CanType type);
357355
static CanType getAnyOptionalObjectTypeImpl(CanType type,
358356
OptionalTypeKind &kind);
@@ -406,11 +404,6 @@ class CanType : public Type {
406404
return isAnyExistentialTypeImpl(*this);
407405
}
408406

409-
/// Given that this type is an existential, return its
410-
/// protocols in a canonical order.
411-
void getExistentialTypeProtocols(
412-
SmallVectorImpl<ProtocolDecl *> &protocols);
413-
414407
/// Break an existential down into a set of constraints.
415408
ExistentialLayout getExistentialLayout();
416409

include/swift/AST/Types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,6 @@ class alignas(1 << TypeAlignInBits) TypeBase {
586586
/// bound.
587587
bool isClassExistentialType();
588588

589-
/// Given that this type is an existential type, produce
590-
/// its list of protocols.
591-
void getExistentialTypeProtocols(SmallVectorImpl<ProtocolDecl *> &protocols);
592-
593589
/// Break an existential down into a set of constraints.
594590
ExistentialLayout getExistentialLayout();
595591

lib/AST/Type.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,6 @@ bool TypeBase::allowsOwnership() {
208208
return getCanonicalType().isAnyClassReferenceType();
209209
}
210210

211-
void TypeBase::getExistentialTypeProtocols(
212-
SmallVectorImpl<ProtocolDecl*> &protocols) {
213-
getCanonicalType().getExistentialTypeProtocols(protocols);
214-
}
215-
216-
void CanType::getExistentialTypeProtocols(
217-
SmallVectorImpl<ProtocolDecl*> &protocols) {
218-
// FIXME: Remove this completely
219-
auto layout = getExistentialLayout();
220-
assert(!layout.superclass && "Subclass existentials not fully supported yet");
221-
assert((!layout.requiresClass || layout.requiresClassImplied) &&
222-
"Explicit AnyObject should not appear yet");
223-
for (auto proto : layout.getProtocols())
224-
protocols.push_back(proto->getDecl());
225-
}
226-
227211
ExistentialLayout::ExistentialLayout(ProtocolType *type) {
228212
assert(type->isCanonical());
229213

0 commit comments

Comments
 (0)