@@ -5740,6 +5740,7 @@ SwiftASTContext::GetTypeInfo(opaque_compiler_type_t type,
5740
5740
5741
5741
case swift::TypeKind::Protocol:
5742
5742
case swift::TypeKind::ProtocolComposition:
5743
+ case swift::TypeKind::Existential:
5743
5744
swift_flags |= eTypeHasChildren | eTypeIsStructUnion | eTypeIsProtocol;
5744
5745
break ;
5745
5746
case swift::TypeKind::ExistentialMetatype:
@@ -5821,6 +5822,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
5821
5822
case swift::TypeKind::DependentMember:
5822
5823
case swift::TypeKind::Protocol:
5823
5824
case swift::TypeKind::ProtocolComposition:
5825
+ case swift::TypeKind::Existential:
5824
5826
case swift::TypeKind::Metatype:
5825
5827
case swift::TypeKind::Module:
5826
5828
case swift::TypeKind::PrimaryArchetype:
@@ -6320,6 +6322,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6320
6322
case swift::TypeKind::Struct:
6321
6323
case swift::TypeKind::Protocol:
6322
6324
case swift::TypeKind::ProtocolComposition:
6325
+ case swift::TypeKind::Existential:
6323
6326
break ;
6324
6327
case swift::TypeKind::LValue:
6325
6328
return lldb::eEncodingUint;
@@ -6408,7 +6411,8 @@ uint32_t SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
6408
6411
}
6409
6412
6410
6413
case swift::TypeKind::Protocol:
6411
- case swift::TypeKind::ProtocolComposition: {
6414
+ case swift::TypeKind::ProtocolComposition:
6415
+ case swift::TypeKind::Existential: {
6412
6416
ProtocolInfo protocol_info;
6413
6417
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6414
6418
break ;
@@ -6546,6 +6550,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
6546
6550
6547
6551
case swift::TypeKind::Protocol:
6548
6552
case swift::TypeKind::ProtocolComposition:
6553
+ case swift::TypeKind::Existential:
6549
6554
return GetNumChildren (type, /* omit_empty_base_classes=*/ false , nullptr );
6550
6555
6551
6556
case swift::TypeKind::ExistentialMetatype:
@@ -6817,7 +6822,8 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
6817
6822
}
6818
6823
6819
6824
case swift::TypeKind::Protocol:
6820
- case swift::TypeKind::ProtocolComposition: {
6825
+ case swift::TypeKind::ProtocolComposition:
6826
+ case swift::TypeKind::Existential: {
6821
6827
ProtocolInfo protocol_info;
6822
6828
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6823
6829
break ;
@@ -6927,6 +6933,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
6927
6933
case swift::TypeKind::Function:
6928
6934
case swift::TypeKind::GenericFunction:
6929
6935
case swift::TypeKind::ProtocolComposition:
6936
+ case swift::TypeKind::Existential:
6930
6937
return 0 ;
6931
6938
case swift::TypeKind::LValue:
6932
6939
return 1 ;
@@ -7245,7 +7252,8 @@ CompilerType SwiftASTContext::GetChildCompilerTypeAtIndex(
7245
7252
}
7246
7253
7247
7254
case swift::TypeKind::Protocol:
7248
- case swift::TypeKind::ProtocolComposition: {
7255
+ case swift::TypeKind::ProtocolComposition:
7256
+ case swift::TypeKind::Existential: {
7249
7257
ProtocolInfo protocol_info;
7250
7258
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
7251
7259
break ;
@@ -7482,7 +7490,8 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
7482
7490
} break ;
7483
7491
7484
7492
case swift::TypeKind::Protocol:
7485
- case swift::TypeKind::ProtocolComposition: {
7493
+ case swift::TypeKind::ProtocolComposition:
7494
+ case swift::TypeKind::Existential: {
7486
7495
ProtocolInfo protocol_info;
7487
7496
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)),
7488
7497
protocol_info))
@@ -7876,6 +7885,7 @@ bool SwiftASTContext::DumpTypeValue(
7876
7885
} break ;
7877
7886
7878
7887
case swift::TypeKind::ProtocolComposition:
7888
+ case swift::TypeKind::Existential:
7879
7889
case swift::TypeKind::UnboundGeneric:
7880
7890
case swift::TypeKind::BoundGenericStruct:
7881
7891
case swift::TypeKind::DynamicSelf:
@@ -8167,6 +8177,21 @@ void SwiftASTContext::DumpTypeDescription(opaque_compiler_type_t type,
8167
8177
s->Printf (" %s\n " , buffer.c_str ());
8168
8178
break ;
8169
8179
}
8180
+ case swift::TypeKind::Existential: {
8181
+ swift::ExistentialType *existential_type =
8182
+ swift_can_type->castTo <swift::ExistentialType>();
8183
+ std::string buffer;
8184
+ llvm::raw_string_ostream ostream (buffer);
8185
+ const swift::PrintOptions &print_options (
8186
+ SwiftASTContext::GetUserVisibleTypePrintingOptions (
8187
+ print_help_if_available));
8188
+
8189
+ existential_type->print (ostream, print_options);
8190
+ ostream.flush ();
8191
+ if (buffer.empty () == false )
8192
+ s->Printf (" %s\n " , buffer.c_str ());
8193
+ break ;
8194
+ }
8170
8195
default : {
8171
8196
swift::NominalType *nominal_type =
8172
8197
llvm::dyn_cast_or_null<swift::NominalType>(
0 commit comments