@@ -230,16 +230,12 @@ void TypeInfo::dump(std::ostream &stream, unsigned Indent) const {
230
230
}
231
231
232
232
BuiltinTypeInfo::BuiltinTypeInfo (TypeRefBuilder &builder,
233
- RemoteRef<BuiltinTypeDescriptor> descriptor)
234
- : TypeInfo(TypeInfoKind::Builtin,
235
- descriptor->Size,
236
- descriptor->getAlignment (),
237
- descriptor->Stride,
233
+ BuiltinTypeDescriptorInterface *descriptor)
234
+ : TypeInfo(TypeInfoKind::Builtin, descriptor->Size,
235
+ descriptor->Alignment, descriptor->Stride,
238
236
descriptor->NumExtraInhabitants,
239
- descriptor->isBitwiseTakable()),
240
- Name(builder.getTypeRefString(
241
- builder.readTypeRef(descriptor, descriptor->TypeName)))
242
- {}
237
+ descriptor->IsBitwiseTakable),
238
+ Name (descriptor->readMangledTypeName ()) {}
243
239
244
240
bool BuiltinTypeInfo::readExtraInhabitantIndex (
245
241
remote::MemoryReader &reader, remote::RemoteAddress address,
@@ -1641,9 +1637,8 @@ const RecordTypeInfo *RecordTypeInfoBuilder::build() {
1641
1637
Kind, Fields);
1642
1638
}
1643
1639
1644
- const ReferenceTypeInfo *
1645
- TypeConverter::getReferenceTypeInfo (ReferenceKind Kind,
1646
- ReferenceCounting Refcounting) {
1640
+ const ReferenceTypeInfo *TypeConverter::getReferenceTypeInfo (
1641
+ ReferenceKind Kind, ReferenceCounting Refcounting) {
1647
1642
auto key = std::make_pair (unsigned (Kind), unsigned (Refcounting));
1648
1643
auto found = ReferenceCache.find (key);
1649
1644
if (found != ReferenceCache.end ())
@@ -1664,7 +1659,7 @@ TypeConverter::getReferenceTypeInfo(ReferenceKind Kind,
1664
1659
//
1665
1660
// Weak references do not have any extra inhabitants.
1666
1661
1667
- auto BuiltinTI = Builder.getBuiltinTypeInfo (TR);
1662
+ auto BuiltinTI = Builder.getBuiltinTypeInfoInterface (TR);
1668
1663
if (BuiltinTI == nullptr ) {
1669
1664
DEBUG_LOG (fprintf (stderr, " No TypeInfo for reference type: " ); TR->dump ());
1670
1665
return nullptr ;
@@ -1689,7 +1684,7 @@ TypeConverter::getReferenceTypeInfo(ReferenceKind Kind,
1689
1684
}
1690
1685
1691
1686
auto *TI = makeTypeInfo<ReferenceTypeInfo>(BuiltinTI->Size ,
1692
- BuiltinTI->getAlignment () ,
1687
+ BuiltinTI->Alignment ,
1693
1688
BuiltinTI->Stride ,
1694
1689
numExtraInhabitants,
1695
1690
bitwiseTakable,
@@ -1705,13 +1700,14 @@ TypeConverter::getThinFunctionTypeInfo() {
1705
1700
if (ThinFunctionTI != nullptr )
1706
1701
return ThinFunctionTI;
1707
1702
1708
- auto descriptor = getBuilder ().getBuiltinTypeInfo (getThinFunctionTypeRef ());
1703
+ auto descriptor =
1704
+ getBuilder ().getBuiltinTypeInfoInterface (getThinFunctionTypeRef ());
1709
1705
if (descriptor == nullptr ) {
1710
1706
DEBUG_LOG (fprintf (stderr, " No TypeInfo for function type\n " ));
1711
1707
return nullptr ;
1712
1708
}
1713
1709
1714
- ThinFunctionTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor);
1710
+ ThinFunctionTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor. get () );
1715
1711
1716
1712
return ThinFunctionTI;
1717
1713
}
@@ -1739,13 +1735,14 @@ TypeConverter::getAnyMetatypeTypeInfo() {
1739
1735
if (AnyMetatypeTI != nullptr )
1740
1736
return AnyMetatypeTI;
1741
1737
1742
- auto descriptor = getBuilder ().getBuiltinTypeInfo (getAnyMetatypeTypeRef ());
1738
+ auto descriptor =
1739
+ getBuilder ().getBuiltinTypeInfoInterface (getAnyMetatypeTypeRef ());
1743
1740
if (descriptor == nullptr ) {
1744
1741
DEBUG_LOG (fprintf (stderr, " No TypeInfo for metatype type\n " ));
1745
1742
return nullptr ;
1746
1743
}
1747
1744
1748
- AnyMetatypeTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor);
1745
+ AnyMetatypeTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor. get () );
1749
1746
1750
1747
return AnyMetatypeTI;
1751
1748
}
@@ -2245,7 +2242,7 @@ class EnumTypeInfoBuilder {
2245
2242
2246
2243
// Do we have a fixed layout?
2247
2244
// TODO: Test whether a missing FixedDescriptor is actually relevant.
2248
- auto FixedDescriptor = TC.getBuilder ().getBuiltinTypeInfo (TR);
2245
+ auto FixedDescriptor = TC.getBuilder ().getBuiltinTypeInfoInterface (TR);
2249
2246
if (!FixedDescriptor || GenericPayloadCases > 0 ) {
2250
2247
// This is a "dynamic multi-payload enum". For example,
2251
2248
// this occurs with:
@@ -2283,9 +2280,9 @@ class EnumTypeInfoBuilder {
2283
2280
// * Has at least two cases with non-zero payload size
2284
2281
// * Has a descriptor stored as BuiltinTypeInfo
2285
2282
Size = FixedDescriptor->Size ;
2286
- Alignment = FixedDescriptor->getAlignment () ;
2283
+ Alignment = FixedDescriptor->Alignment ;
2287
2284
NumExtraInhabitants = FixedDescriptor->NumExtraInhabitants ;
2288
- BitwiseTakable = FixedDescriptor->isBitwiseTakable () ;
2285
+ BitwiseTakable = FixedDescriptor->IsBitwiseTakable ;
2289
2286
unsigned Stride = ((Size + Alignment - 1 ) & ~(Alignment - 1 ));
2290
2287
if (Stride == 0 )
2291
2288
Stride = 1 ;
@@ -2395,12 +2392,12 @@ class LowerType
2395
2392
2396
2393
// / Otherwise, get the fixed layout information from reflection
2397
2394
// / metadata.
2398
- auto descriptor = TC.getBuilder ().getBuiltinTypeInfo (B);
2395
+ auto descriptor = TC.getBuilder ().getBuiltinTypeInfoInterface (B);
2399
2396
if (descriptor == nullptr ) {
2400
2397
DEBUG_LOG (fprintf (stderr, " No TypeInfo for builtin type: " ); B->dump ());
2401
2398
return nullptr ;
2402
2399
}
2403
- return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (), descriptor);
2400
+ return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (), descriptor. get () );
2404
2401
}
2405
2402
2406
2403
const TypeInfo *visitAnyNominalTypeRef (const TypeRef *TR) {
@@ -2424,15 +2421,15 @@ class LowerType
2424
2421
// descriptor to see if we at least know its size
2425
2422
// and alignment.
2426
2423
if (auto ImportedTypeDescriptor =
2427
- TC.getBuilder ().getBuiltinTypeInfo (TR)) {
2424
+ TC.getBuilder ().getBuiltinTypeInfoInterface (TR)) {
2428
2425
// This might be an external type we treat as opaque (like C structs),
2429
2426
// the external type info provider might have better type information,
2430
2427
// so ask it first.
2431
2428
if (auto External = QueryExternalTypeInfoProvider ())
2432
2429
return External;
2433
2430
2434
2431
return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (),
2435
- ImportedTypeDescriptor);
2432
+ ImportedTypeDescriptor. get () );
2436
2433
}
2437
2434
2438
2435
if (FD == nullptr ) {
0 commit comments