@@ -2099,7 +2099,7 @@ const TypeInfo *TypeConverter::convertType(CanType ty) {
2099
2099
case TypeKind::Error: {
2100
2100
// We might see error types if type checking has failed.
2101
2101
// Try to do something graceful and return an zero sized type.
2102
- auto &ctx = ty-> getASTContext () ;
2102
+ auto &ctx = IGM. Context ;
2103
2103
return convertTupleType (cast<TupleType>(ctx.TheEmptyTupleType ));
2104
2104
}
2105
2105
#define UNCHECKED_TYPE (id, parent ) \
@@ -2172,7 +2172,6 @@ const TypeInfo *TypeConverter::convertType(CanType ty) {
2172
2172
case TypeKind::PrimaryArchetype:
2173
2173
case TypeKind::OpenedArchetype:
2174
2174
case TypeKind::OpaqueTypeArchetype:
2175
- case TypeKind::PackArchetype:
2176
2175
case TypeKind::ElementArchetype:
2177
2176
return convertArchetypeType (cast<ArchetypeType>(ty));
2178
2177
case TypeKind::Class:
@@ -2213,11 +2212,24 @@ const TypeInfo *TypeConverter::convertType(CanType ty) {
2213
2212
return convertBlockStorageType (cast<SILBlockStorageType>(ty));
2214
2213
case TypeKind::SILBox:
2215
2214
return convertBoxType (cast<SILBoxType>(ty));
2215
+ case TypeKind::Pack:
2216
+ return convertPackType (cast<PackType>(ty));
2217
+ case TypeKind::PackArchetype: {
2218
+ // FIXME: This is the wrong place for this kind of wrapping
2219
+ SmallVector<Type> elts;
2220
+ auto archetypeTy = cast<PackArchetypeType>(ty);
2221
+ elts.push_back (PackExpansionType::get (archetypeTy,
2222
+ archetypeTy->getReducedShape ()));
2223
+ return convertPackType (PackType::get (IGM.Context , elts));
2224
+ }
2225
+ case TypeKind::PackExpansion: {
2226
+ // FIXME: This is the wrong place for this kind of wrapping
2227
+ SmallVector<Type> elts;
2228
+ elts.push_back (ty);
2229
+ return convertPackType (PackType::get (IGM.Context , elts));
2230
+ }
2216
2231
case TypeKind::SILToken:
2217
2232
llvm_unreachable (" should not be asking for representation of a SILToken" );
2218
- case TypeKind::Pack:
2219
- case TypeKind::PackExpansion:
2220
- llvm_unreachable (" Unimplemented!" );
2221
2233
}
2222
2234
}
2223
2235
llvm_unreachable (" bad type kind" );
@@ -2233,6 +2245,12 @@ const TypeInfo *TypeConverter::convertInOutType(InOutType *T) {
2233
2245
IGM.getPointerAlignment ());
2234
2246
}
2235
2247
2248
+ const TypeInfo *TypeConverter::convertPackType (PackType *pack) {
2249
+ return new RawPointerTypeInfo (IGM.Int8PtrTy ,
2250
+ IGM.getPointerSize (),
2251
+ IGM.getPointerAlignment ());
2252
+ }
2253
+
2236
2254
// / Convert a reference storage type. The implementation here depends on the
2237
2255
// / underlying reference type. The type may be optional.
2238
2256
#define REF_STORAGE (Name, ...) \
0 commit comments