@@ -1284,7 +1284,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1284
1284
// offsets, with conditional conformances closest to 0.
1285
1285
unsigned NextPrivateDataIndex = 0 ;
1286
1286
bool ResilientConformance;
1287
- bool RequiresSpecialization = false ;
1288
1287
1289
1288
const ProtocolInfo Π
1290
1289
@@ -1306,21 +1305,14 @@ class AccessorConformanceInfo : public ConformanceInfo {
1306
1305
PI(IGM.getProtocolInfo(SILWT->getConformance ()->getProtocol(),
1307
1306
(ResilientConformance
1308
1307
? ProtocolInfoKind::RequirementSignature
1309
- : ProtocolInfoKind::Full))) {
1310
- // If the conformance is resilient, we require runtime instantiation.
1311
- if (ResilientConformance)
1312
- RequiresSpecialization = true ;
1313
- }
1308
+ : ProtocolInfoKind::Full))) {}
1314
1309
1315
1310
// / The number of entries in the witness table.
1316
1311
unsigned getTableSize () const { return TableSize; }
1317
1312
1318
1313
// / The number of private entries in the witness table.
1319
1314
unsigned getTablePrivateSize () const { return NextPrivateDataIndex; }
1320
1315
1321
- // / Whether this witness table must be specialized at runtime.
1322
- bool requiresSpecialization () const { return RequiresSpecialization; }
1323
-
1324
1316
// / The top-level entry point.
1325
1317
void build ();
1326
1318
@@ -1370,7 +1362,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1370
1362
}
1371
1363
1372
1364
// Otherwise, we'll need to derive it at instantiation time.
1373
- RequiresSpecialization = true ;
1374
1365
SpecializedBaseConformances.push_back ({Table.size (), &conf});
1375
1366
Table.addNullPointer (IGM.Int8PtrTy );
1376
1367
}
@@ -1437,8 +1428,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1437
1428
auto associate =
1438
1429
Conformance.getTypeWitness (requirement.getAssociation (), nullptr )
1439
1430
->getCanonicalType ();
1440
- if (associate->hasTypeParameter ())
1441
- RequiresSpecialization = true ;
1442
1431
llvm::Constant *witness =
1443
1432
IGM.getAssociatedTypeWitness (associate, /* inProtocolContext=*/ false );
1444
1433
Table.addBitCast (witness, IGM.Int8PtrTy );
@@ -1463,9 +1452,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1463
1452
requirement.getAssociation (),
1464
1453
requirement.getAssociatedRequirement ());
1465
1454
1466
- if (requirement.getAssociation ()->hasTypeParameter ())
1467
- RequiresSpecialization = true ;
1468
-
1469
1455
#ifndef NDEBUG
1470
1456
assert (entry.getKind () == SILWitnessTable::AssociatedTypeProtocol
1471
1457
&& " sil witness table does not match protocol" );
@@ -1516,7 +1502,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1516
1502
1517
1503
// / Allocate another word of private data storage in the conformance table.
1518
1504
unsigned getNextPrivateDataIndex () {
1519
- RequiresSpecialization = true ;
1520
1505
return NextPrivateDataIndex++;
1521
1506
}
1522
1507
@@ -2309,7 +2294,9 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
2309
2294
// descriptor.
2310
2295
ConformanceDescription description (conf, wt, global, tableSize,
2311
2296
wtableBuilder.getTablePrivateSize (),
2312
- wtableBuilder.requiresSpecialization (),
2297
+ isDependentConformance (
2298
+ conf,
2299
+ /* considerResilience=*/ true ),
2313
2300
isDependentConformance (
2314
2301
conf,
2315
2302
/* considerResilience=*/ false ));
0 commit comments