@@ -1413,8 +1413,8 @@ class AccessorConformanceInfo : public ConformanceInfo {
1413
1413
1414
1414
WitnessTableBuilderBase (IRGenModule &IGM, SILWitnessTable *SILWT)
1415
1415
: IGM(IGM), SILWT(SILWT),
1416
- Conformance (*SILWT->getConformance ()),
1417
- ConformanceInContext(*mapConformanceIntoContext (SILWT->getConformance ())),
1416
+ Conformance (*SILWT->getConformance ()->getRootConformance() ),
1417
+ ConformanceInContext(*mapConformanceIntoContext (SILWT->getConformance ()->getRootConformance() )),
1418
1418
ConcreteType(Conformance.getDeclContext()
1419
1419
->mapTypeIntoContext(Conformance.getType())
1420
1420
->getCanonicalType()) {}
@@ -2352,7 +2352,7 @@ void IRGenerator::ensureRelativeSymbolCollocation(SILWitnessTable &wt) {
2352
2352
2353
2353
// Only resilient conformances use relative pointers for witness methods.
2354
2354
if (wt.isDeclaration () || isAvailableExternally (wt.getLinkage ()) ||
2355
- !CurrentIGM->isResilientConformance (wt.getConformance ()))
2355
+ !CurrentIGM->isResilientConformance (wt.getConformance ()-> getRootConformance () ))
2356
2356
return ;
2357
2357
2358
2358
for (auto &entry : wt.getEntries ()) {
@@ -2592,14 +2592,15 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
2592
2592
IRGen.ensureRelativeSymbolCollocation (*wt);
2593
2593
2594
2594
auto conf = wt->getConformance ();
2595
+ RootProtocolConformance *rootConf = conf->getRootConformance ();
2595
2596
PrettyStackTraceConformance _st (" emitting witness table for" , conf);
2596
2597
2597
2598
unsigned tableSize = 0 ;
2598
2599
llvm::GlobalVariable *global = nullptr ;
2599
2600
llvm::Function *instantiationFunction = nullptr ;
2600
- bool isDependent = isDependentConformance (conf );
2601
+ bool isDependent = isDependentConformance (rootConf );
2601
2602
SmallVector<llvm::Constant *, 4 > resilientWitnesses;
2602
- bool isResilient = isResilientConformance (conf );
2603
+ bool isResilient = isResilientConformance (rootConf );
2603
2604
bool useRelativeProtocolWitnessTable =
2604
2605
IRGen.Opts .UseRelativeProtocolWitnessTables ;
2605
2606
if (useRelativeProtocolWitnessTable &&
@@ -2659,7 +2660,7 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
2659
2660
// Collect the information that will go into the protocol conformance
2660
2661
// descriptor.
2661
2662
unsigned tablePrivateSize = wt->getConditionalConformances ().size ();
2662
- ConformanceDescription description (conf , wt, global, tableSize,
2663
+ ConformanceDescription description (rootConf , wt, global, tableSize,
2663
2664
tablePrivateSize, isDependent);
2664
2665
2665
2666
// Build the instantiation function, we if need one.
0 commit comments