@@ -230,16 +230,12 @@ void TypeInfo::dump(std::ostream &stream, unsigned Indent) const {
230230}
231231
232232BuiltinTypeInfo::BuiltinTypeInfo (TypeRefBuilder &builder,
233- RemoteRef<BuiltinTypeDescriptor> descriptor)
234- : TypeInfo(TypeInfoKind::Builtin,
235- descriptor->Size,
236- descriptor->getAlignment (),
237- descriptor->Stride,
238- descriptor->NumExtraInhabitants,
239- descriptor->isBitwiseTakable()),
240- Name(builder.getTypeRefString(
241- builder.readTypeRef(descriptor, descriptor->TypeName)))
242- {}
233+ BuiltinTypeDescriptorBase &descriptor)
234+ : TypeInfo(TypeInfoKind::Builtin, descriptor.Size,
235+ descriptor.Alignment, descriptor.Stride,
236+ descriptor.NumExtraInhabitants,
237+ descriptor.IsBitwiseTakable),
238+ Name (descriptor.getMangledTypeName()) {}
243239
244240bool BuiltinTypeInfo::readExtraInhabitantIndex (
245241 remote::MemoryReader &reader, remote::RemoteAddress address,
@@ -1641,9 +1637,8 @@ const RecordTypeInfo *RecordTypeInfoBuilder::build() {
16411637 Kind, Fields);
16421638}
16431639
1644- const ReferenceTypeInfo *
1645- TypeConverter::getReferenceTypeInfo (ReferenceKind Kind,
1646- ReferenceCounting Refcounting) {
1640+ const ReferenceTypeInfo *TypeConverter::getReferenceTypeInfo (
1641+ ReferenceKind Kind, ReferenceCounting Refcounting) {
16471642 auto key = std::make_pair (unsigned (Kind), unsigned (Refcounting));
16481643 auto found = ReferenceCache.find (key);
16491644 if (found != ReferenceCache.end ())
@@ -1664,7 +1659,7 @@ TypeConverter::getReferenceTypeInfo(ReferenceKind Kind,
16641659 //
16651660 // Weak references do not have any extra inhabitants.
16661661
1667- auto BuiltinTI = Builder.getBuiltinTypeInfo (TR);
1662+ auto BuiltinTI = Builder.getBuiltinTypeDescriptor (TR);
16681663 if (BuiltinTI == nullptr ) {
16691664 DEBUG_LOG (fprintf (stderr, " No TypeInfo for reference type: " ); TR->dump ());
16701665 return nullptr ;
@@ -1689,7 +1684,7 @@ TypeConverter::getReferenceTypeInfo(ReferenceKind Kind,
16891684 }
16901685
16911686 auto *TI = makeTypeInfo<ReferenceTypeInfo>(BuiltinTI->Size ,
1692- BuiltinTI->getAlignment () ,
1687+ BuiltinTI->Alignment ,
16931688 BuiltinTI->Stride ,
16941689 numExtraInhabitants,
16951690 bitwiseTakable,
@@ -1705,13 +1700,14 @@ TypeConverter::getThinFunctionTypeInfo() {
17051700 if (ThinFunctionTI != nullptr )
17061701 return ThinFunctionTI;
17071702
1708- auto descriptor = getBuilder ().getBuiltinTypeInfo (getThinFunctionTypeRef ());
1703+ auto descriptor =
1704+ getBuilder ().getBuiltinTypeDescriptor (getThinFunctionTypeRef ());
17091705 if (descriptor == nullptr ) {
17101706 DEBUG_LOG (fprintf (stderr, " No TypeInfo for function type\n " ));
17111707 return nullptr ;
17121708 }
17131709
1714- ThinFunctionTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor);
1710+ ThinFunctionTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), * descriptor. get () );
17151711
17161712 return ThinFunctionTI;
17171713}
@@ -1739,13 +1735,14 @@ TypeConverter::getAnyMetatypeTypeInfo() {
17391735 if (AnyMetatypeTI != nullptr )
17401736 return AnyMetatypeTI;
17411737
1742- auto descriptor = getBuilder ().getBuiltinTypeInfo (getAnyMetatypeTypeRef ());
1738+ auto descriptor =
1739+ getBuilder ().getBuiltinTypeDescriptor (getAnyMetatypeTypeRef ());
17431740 if (descriptor == nullptr ) {
17441741 DEBUG_LOG (fprintf (stderr, " No TypeInfo for metatype type\n " ));
17451742 return nullptr ;
17461743 }
17471744
1748- AnyMetatypeTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), descriptor);
1745+ AnyMetatypeTI = makeTypeInfo<BuiltinTypeInfo>(getBuilder (), * descriptor. get () );
17491746
17501747 return AnyMetatypeTI;
17511748}
@@ -2245,7 +2242,7 @@ class EnumTypeInfoBuilder {
22452242
22462243 // Do we have a fixed layout?
22472244 // TODO: Test whether a missing FixedDescriptor is actually relevant.
2248- auto FixedDescriptor = TC.getBuilder ().getBuiltinTypeInfo (TR);
2245+ auto FixedDescriptor = TC.getBuilder ().getBuiltinTypeDescriptor (TR);
22492246 if (!FixedDescriptor || GenericPayloadCases > 0 ) {
22502247 // This is a "dynamic multi-payload enum". For example,
22512248 // this occurs with:
@@ -2283,9 +2280,9 @@ class EnumTypeInfoBuilder {
22832280 // * Has at least two cases with non-zero payload size
22842281 // * Has a descriptor stored as BuiltinTypeInfo
22852282 Size = FixedDescriptor->Size ;
2286- Alignment = FixedDescriptor->getAlignment () ;
2283+ Alignment = FixedDescriptor->Alignment ;
22872284 NumExtraInhabitants = FixedDescriptor->NumExtraInhabitants ;
2288- BitwiseTakable = FixedDescriptor->isBitwiseTakable () ;
2285+ BitwiseTakable = FixedDescriptor->IsBitwiseTakable ;
22892286 unsigned Stride = ((Size + Alignment - 1 ) & ~(Alignment - 1 ));
22902287 if (Stride == 0 )
22912288 Stride = 1 ;
@@ -2395,12 +2392,12 @@ class LowerType
23952392
23962393 // / Otherwise, get the fixed layout information from reflection
23972394 // / metadata.
2398- auto descriptor = TC.getBuilder ().getBuiltinTypeInfo (B);
2395+ auto descriptor = TC.getBuilder ().getBuiltinTypeDescriptor (B);
23992396 if (descriptor == nullptr ) {
24002397 DEBUG_LOG (fprintf (stderr, " No TypeInfo for builtin type: " ); B->dump ());
24012398 return nullptr ;
24022399 }
2403- return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (), descriptor);
2400+ return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (), * descriptor. get () );
24042401 }
24052402
24062403 const TypeInfo *visitAnyNominalTypeRef (const TypeRef *TR) {
@@ -2424,15 +2421,15 @@ class LowerType
24242421 // descriptor to see if we at least know its size
24252422 // and alignment.
24262423 if (auto ImportedTypeDescriptor =
2427- TC.getBuilder ().getBuiltinTypeInfo (TR)) {
2424+ TC.getBuilder ().getBuiltinTypeDescriptor (TR)) {
24282425 // This might be an external type we treat as opaque (like C structs),
24292426 // the external type info provider might have better type information,
24302427 // so ask it first.
24312428 if (auto External = QueryExternalTypeInfoProvider ())
24322429 return External;
24332430
24342431 return TC.makeTypeInfo <BuiltinTypeInfo>(TC.getBuilder (),
2435- ImportedTypeDescriptor);
2432+ * ImportedTypeDescriptor. get () );
24362433 }
24372434
24382435 if (FD == nullptr ) {
0 commit comments