@@ -5737,6 +5737,7 @@ SwiftASTContext::GetTypeInfo(opaque_compiler_type_t type,
5737
5737
5738
5738
case swift::TypeKind::Protocol:
5739
5739
case swift::TypeKind::ProtocolComposition:
5740
+ case swift::TypeKind::Existential:
5740
5741
swift_flags |= eTypeHasChildren | eTypeIsStructUnion | eTypeIsProtocol;
5741
5742
break ;
5742
5743
case swift::TypeKind::ExistentialMetatype:
@@ -5818,6 +5819,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
5818
5819
case swift::TypeKind::DependentMember:
5819
5820
case swift::TypeKind::Protocol:
5820
5821
case swift::TypeKind::ProtocolComposition:
5822
+ case swift::TypeKind::Existential:
5821
5823
case swift::TypeKind::Metatype:
5822
5824
case swift::TypeKind::Module:
5823
5825
case swift::TypeKind::PrimaryArchetype:
@@ -6319,6 +6321,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6319
6321
case swift::TypeKind::Struct:
6320
6322
case swift::TypeKind::Protocol:
6321
6323
case swift::TypeKind::ProtocolComposition:
6324
+ case swift::TypeKind::Existential:
6322
6325
break ;
6323
6326
case swift::TypeKind::LValue:
6324
6327
return lldb::eEncodingUint;
@@ -6407,7 +6410,8 @@ uint32_t SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
6407
6410
}
6408
6411
6409
6412
case swift::TypeKind::Protocol:
6410
- case swift::TypeKind::ProtocolComposition: {
6413
+ case swift::TypeKind::ProtocolComposition:
6414
+ case swift::TypeKind::Existential: {
6411
6415
ProtocolInfo protocol_info;
6412
6416
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6413
6417
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:
@@ -6818,7 +6823,8 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
6818
6823
}
6819
6824
6820
6825
case swift::TypeKind::Protocol:
6821
- case swift::TypeKind::ProtocolComposition: {
6826
+ case swift::TypeKind::ProtocolComposition:
6827
+ case swift::TypeKind::Existential: {
6822
6828
ProtocolInfo protocol_info;
6823
6829
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
6824
6830
break ;
@@ -6930,6 +6936,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
6930
6936
case swift::TypeKind::Function:
6931
6937
case swift::TypeKind::GenericFunction:
6932
6938
case swift::TypeKind::ProtocolComposition:
6939
+ case swift::TypeKind::Existential:
6933
6940
return 0 ;
6934
6941
case swift::TypeKind::LValue:
6935
6942
return 1 ;
@@ -7248,7 +7255,8 @@ CompilerType SwiftASTContext::GetChildCompilerTypeAtIndex(
7248
7255
}
7249
7256
7250
7257
case swift::TypeKind::Protocol:
7251
- case swift::TypeKind::ProtocolComposition: {
7258
+ case swift::TypeKind::ProtocolComposition:
7259
+ case swift::TypeKind::Existential: {
7252
7260
ProtocolInfo protocol_info;
7253
7261
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)), protocol_info))
7254
7262
break ;
@@ -7486,7 +7494,8 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
7486
7494
} break ;
7487
7495
7488
7496
case swift::TypeKind::Protocol:
7489
- case swift::TypeKind::ProtocolComposition: {
7497
+ case swift::TypeKind::ProtocolComposition:
7498
+ case swift::TypeKind::Existential: {
7490
7499
ProtocolInfo protocol_info;
7491
7500
if (!GetProtocolTypeInfo (ToCompilerType (GetSwiftType (type)),
7492
7501
protocol_info))
@@ -7882,6 +7891,7 @@ bool SwiftASTContext::DumpTypeValue(
7882
7891
} break ;
7883
7892
7884
7893
case swift::TypeKind::ProtocolComposition:
7894
+ case swift::TypeKind::Existential:
7885
7895
case swift::TypeKind::UnboundGeneric:
7886
7896
case swift::TypeKind::BoundGenericStruct:
7887
7897
case swift::TypeKind::DynamicSelf:
@@ -8169,6 +8179,21 @@ void SwiftASTContext::DumpTypeDescription(opaque_compiler_type_t type,
8169
8179
s->Printf (" %s\n " , buffer.c_str ());
8170
8180
break ;
8171
8181
}
8182
+ case swift::TypeKind::Existential: {
8183
+ swift::ExistentialType *existential_type =
8184
+ swift_can_type->castTo <swift::ExistentialType>();
8185
+ std::string buffer;
8186
+ llvm::raw_string_ostream ostream (buffer);
8187
+ const swift::PrintOptions &print_options (
8188
+ SwiftASTContext::GetUserVisibleTypePrintingOptions (
8189
+ print_help_if_available));
8190
+
8191
+ existential_type->print (ostream, print_options);
8192
+ ostream.flush ();
8193
+ if (buffer.empty () == false )
8194
+ s->Printf (" %s\n " , buffer.c_str ());
8195
+ break ;
8196
+ }
8172
8197
default : {
8173
8198
swift::NominalType *nominal_type =
8174
8199
llvm::dyn_cast_or_null<swift::NominalType>(
0 commit comments