@@ -217,6 +217,13 @@ class PrintTypeInfo {
217217 stream << " )" ;
218218 return ;
219219 }
220+
221+ case TypeInfoKind::Array: {
222+ printHeader (" array" );
223+ printBasic (TI);
224+ stream << " )" ;
225+ return ;
226+ }
220227 }
221228
222229 swift_unreachable (" Bad TypeInfo kind" );
@@ -475,6 +482,26 @@ BitMask RecordTypeInfo::getSpareBits(TypeConverter &TC, bool &hasAddrOnly) const
475482 return mask;
476483}
477484
485+ ArrayTypeInfo::ArrayTypeInfo (intptr_t size, const TypeInfo *elementTI)
486+ : TypeInfo(TypeInfoKind::Array,
487+ /* size */ elementTI->getStride () * size,
488+ /* alignment */ elementTI->getAlignment(),
489+ /* stride */ elementTI->getStride() * size,
490+ /* numExtraInhabitants */ elementTI->getNumExtraInhabitants(),
491+ /* isBitwiseTakable */ elementTI->isBitwiseTakable()),
492+ ElementTI(elementTI) {}
493+
494+ bool ArrayTypeInfo::readExtraInhabitantIndex (
495+ remote::MemoryReader &reader, remote::RemoteAddress address,
496+ int *extraInhabitantIndex) const {
497+ return ElementTI->readExtraInhabitantIndex (reader, address,
498+ extraInhabitantIndex);
499+ }
500+
501+ BitMask ArrayTypeInfo::getSpareBits (TypeConverter &TC, bool &hasAddrOnly) const {
502+ return ElementTI->getSpareBits (TC, hasAddrOnly);
503+ }
504+
478505class UnsupportedEnumTypeInfo : public EnumTypeInfo {
479506public:
480507 UnsupportedEnumTypeInfo (unsigned Size, unsigned Alignment,
@@ -1786,6 +1813,14 @@ class HasFixedSize
17861813 bool visitOpaqueArchetypeTypeRef (const OpaqueArchetypeTypeRef *O) {
17871814 return false ;
17881815 }
1816+
1817+ bool visitIntegerTypeRef (const IntegerTypeRef *I) {
1818+ return false ;
1819+ }
1820+
1821+ bool visitBuiltinFixedArrayTypeRef (const BuiltinFixedArrayTypeRef *BA) {
1822+ return visit (BA->getElementType ());
1823+ }
17891824};
17901825
17911826bool TypeConverter::hasFixedSize (const TypeRef *TR) {
@@ -1921,6 +1956,14 @@ class HasSingletonMetatype
19211956 MetatypeRepresentation visitOpaqueArchetypeTypeRef (const OpaqueArchetypeTypeRef *O) {
19221957 return MetatypeRepresentation::Unknown;
19231958 }
1959+
1960+ MetatypeRepresentation visitIntegerTypeRef (const IntegerTypeRef *I) {
1961+ return MetatypeRepresentation::Unknown;
1962+ }
1963+
1964+ MetatypeRepresentation visitBuiltinFixedArrayTypeRef (const BuiltinFixedArrayTypeRef *BA) {
1965+ return visit (BA->getElementType ());
1966+ }
19241967};
19251968
19261969class EnumTypeInfoBuilder {
@@ -2544,6 +2587,17 @@ class LowerType
25442587 DEBUG_LOG (fprintf (stderr, " Can't lower unresolved opaque archetype TypeRef" ));
25452588 return nullptr ;
25462589 }
2590+
2591+ const TypeInfo *visitIntegerTypeRef (const IntegerTypeRef *I) {
2592+ DEBUG_LOG (fprintf (stderr, " Can't lower integer TypeRef" ));
2593+ return nullptr ;
2594+ }
2595+
2596+ const TypeInfo *visitBuiltinFixedArrayTypeRef (const BuiltinFixedArrayTypeRef *BA) {
2597+ auto elementTI = visit (BA->getElementType ());
2598+
2599+ return TC.makeTypeInfo <ArrayTypeInfo>(BA->getSize (), elementTI);
2600+ }
25472601};
25482602
25492603const TypeInfo *
0 commit comments