@@ -5719,6 +5719,7 @@ SwiftASTContext::GetTypeInfo(opaque_compiler_type_t type,
5719
5719
5720
5720
case swift::TypeKind::Protocol:
5721
5721
case swift::TypeKind::ProtocolComposition:
5722
+ case swift::TypeKind::Existential:
5722
5723
swift_flags |= eTypeHasChildren | eTypeIsStructUnion | eTypeIsProtocol;
5723
5724
break ;
5724
5725
case swift::TypeKind::ExistentialMetatype:
@@ -5800,6 +5801,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
5800
5801
case swift::TypeKind::DependentMember:
5801
5802
case swift::TypeKind::Protocol:
5802
5803
case swift::TypeKind::ProtocolComposition:
5804
+ case swift::TypeKind::Existential:
5803
5805
case swift::TypeKind::Metatype:
5804
5806
case swift::TypeKind::Module:
5805
5807
case swift::TypeKind::PrimaryArchetype:
@@ -6301,6 +6303,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6301
6303
case swift::TypeKind::Struct:
6302
6304
case swift::TypeKind::Protocol:
6303
6305
case swift::TypeKind::ProtocolComposition:
6306
+ case swift::TypeKind::Existential:
6304
6307
break ;
6305
6308
case swift::TypeKind::LValue:
6306
6309
return lldb::eEncodingUint;
@@ -6389,7 +6392,8 @@ uint32_t SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
6389
6392
}
6390
6393
6391
6394
case swift::TypeKind::Protocol:
6392
- case swift::TypeKind::ProtocolComposition: {
6395
+ case swift::TypeKind::ProtocolComposition:
6396
+ case swift::TypeKind::Existential: {
6393
6397
ProtocolInfo protocol_info;
6394
6398
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6395
6399
break ;
@@ -6528,6 +6532,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
6528
6532
6529
6533
case swift::TypeKind::Protocol:
6530
6534
case swift::TypeKind::ProtocolComposition:
6535
+ case swift::TypeKind::Existential:
6531
6536
return GetNumChildren (type, /* omit_empty_base_classes=*/ false , nullptr );
6532
6537
6533
6538
case swift::TypeKind::ExistentialMetatype:
@@ -6800,7 +6805,8 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
6800
6805
}
6801
6806
6802
6807
case swift::TypeKind::Protocol:
6803
- case swift::TypeKind::ProtocolComposition: {
6808
+ case swift::TypeKind::ProtocolComposition:
6809
+ case swift::TypeKind::Existential: {
6804
6810
ProtocolInfo protocol_info;
6805
6811
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6806
6812
break ;
@@ -6912,6 +6918,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
6912
6918
case swift::TypeKind::Function:
6913
6919
case swift::TypeKind::GenericFunction:
6914
6920
case swift::TypeKind::ProtocolComposition:
6921
+ case swift::TypeKind::Existential:
6915
6922
return 0 ;
6916
6923
case swift::TypeKind::LValue:
6917
6924
return 1 ;
@@ -7230,7 +7237,8 @@ CompilerType SwiftASTContext::GetChildCompilerTypeAtIndex(
7230
7237
}
7231
7238
7232
7239
case swift::TypeKind::Protocol:
7233
- case swift::TypeKind::ProtocolComposition: {
7240
+ case swift::TypeKind::ProtocolComposition:
7241
+ case swift::TypeKind::Existential: {
7234
7242
ProtocolInfo protocol_info;
7235
7243
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
7236
7244
break ;
@@ -7468,7 +7476,8 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
7468
7476
} break ;
7469
7477
7470
7478
case swift::TypeKind::Protocol:
7471
- case swift::TypeKind::ProtocolComposition: {
7479
+ case swift::TypeKind::ProtocolComposition:
7480
+ case swift::TypeKind::Existential: {
7472
7481
ProtocolInfo protocol_info;
7473
7482
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)),
7474
7483
protocol_info))
@@ -7864,6 +7873,7 @@ bool SwiftASTContext::DumpTypeValue(
7864
7873
} break ;
7865
7874
7866
7875
case swift::TypeKind::ProtocolComposition:
7876
+ case swift::TypeKind::Existential:
7867
7877
case swift::TypeKind::UnboundGeneric:
7868
7878
case swift::TypeKind::BoundGenericStruct:
7869
7879
case swift::TypeKind::DynamicSelf:
@@ -8151,6 +8161,21 @@ void SwiftASTContext::DumpTypeDescription(opaque_compiler_type_t type,
8151
8161
s->Printf (" %s\n " , buffer.c_str ());
8152
8162
break ;
8153
8163
}
8164
+ case swift::TypeKind::Existential: {
8165
+ swift::ExistentialType *existential_type =
8166
+ swift_can_type->castTo <swift::ExistentialType>();
8167
+ std::string buffer;
8168
+ llvm::raw_string_ostream ostream (buffer);
8169
+ const swift::PrintOptions &print_options (
8170
+ SwiftASTContext::GetUserVisibleTypePrintingOptions (
8171
+ print_help_if_available));
8172
+
8173
+ existential_type->print (ostream, print_options);
8174
+ ostream.flush ();
8175
+ if (buffer.empty () == false )
8176
+ s->Printf (" %s\n " , buffer.c_str ());
8177
+ break ;
8178
+ }
8154
8179
default : {
8155
8180
swift::NominalType *nominal_type =
8156
8181
llvm::dyn_cast_or_null<swift::NominalType>(
0 commit comments