@@ -1467,15 +1467,7 @@ TypeCacheEntry TypeConverter::getTypeEntry(CanType canonicalTy) {
1467
1467
}
1468
1468
1469
1469
// Convert the type.
1470
- TypeCacheEntry convertedEntry = convertType (exemplarTy);
1471
- auto convertedTI = convertedEntry.dyn_cast <const TypeInfo*>();
1472
-
1473
- // If that gives us a forward declaration (which can happen with
1474
- // bound generic types), don't propagate that into the cache here,
1475
- // because we won't know how to clear it later.
1476
- if (!convertedTI) {
1477
- return convertedEntry;
1478
- }
1470
+ auto *convertedTI = convertType (exemplarTy);
1479
1471
1480
1472
// Cache the entry under the original type and the exemplar type, so that
1481
1473
// we can avoid relowering equivalent types.
@@ -1600,7 +1592,7 @@ convertPrimitiveBuiltin(IRGenModule &IGM, CanType canTy) {
1600
1592
}
1601
1593
}
1602
1594
1603
- TypeCacheEntry TypeConverter::convertType (CanType ty) {
1595
+ const TypeInfo * TypeConverter::convertType (CanType ty) {
1604
1596
PrettyStackTraceType stackTrace (IGM.Context , " converting" , ty);
1605
1597
1606
1598
switch (ty->getKind ()) {
@@ -1828,8 +1820,8 @@ static bool isIRTypeDependent(IRGenModule &IGM, NominalTypeDecl *decl) {
1828
1820
}
1829
1821
}
1830
1822
1831
- TypeCacheEntry TypeConverter::convertAnyNominalType (CanType type,
1832
- NominalTypeDecl *decl) {
1823
+ const TypeInfo * TypeConverter::convertAnyNominalType (CanType type,
1824
+ NominalTypeDecl *decl) {
1833
1825
// By "any", we don't mean existentials.
1834
1826
assert (!isa<ProtocolDecl>(decl));
1835
1827
@@ -1871,7 +1863,7 @@ TypeCacheEntry TypeConverter::convertAnyNominalType(CanType type,
1871
1863
auto &Cache = Types.getCacheFor (/* isDependent*/ false , CompletelyFragile);
1872
1864
auto entry = Cache.find (key);
1873
1865
if (entry != Cache.end ())
1874
- return entry->second ;
1866
+ return entry->second . get < const TypeInfo *>() ;
1875
1867
1876
1868
switch (decl->getKind ()) {
1877
1869
#define NOMINAL_TYPE_DECL (ID, PARENT )
0 commit comments