@@ -1413,8 +1413,8 @@ class AccessorConformanceInfo : public ConformanceInfo {
14131413
14141414 WitnessTableBuilderBase (IRGenModule &IGM, SILWitnessTable *SILWT)
14151415 : IGM(IGM), SILWT(SILWT),
1416- Conformance (*SILWT->getConformance ()),
1417- ConformanceInContext(*mapConformanceIntoContext (SILWT->getConformance ())),
1416+ Conformance (*SILWT->getConformance ()->getRootConformance() ),
1417+ ConformanceInContext(*mapConformanceIntoContext (SILWT->getConformance ()->getRootConformance() )),
14181418 ConcreteType(Conformance.getDeclContext()
14191419 ->mapTypeIntoContext(Conformance.getType())
14201420 ->getCanonicalType()) {}
@@ -2352,7 +2352,7 @@ void IRGenerator::ensureRelativeSymbolCollocation(SILWitnessTable &wt) {
23522352
23532353 // Only resilient conformances use relative pointers for witness methods.
23542354 if (wt.isDeclaration () || isAvailableExternally (wt.getLinkage ()) ||
2355- !CurrentIGM->isResilientConformance (wt.getConformance ()))
2355+ !CurrentIGM->isResilientConformance (wt.getConformance ()-> getRootConformance () ))
23562356 return ;
23572357
23582358 for (auto &entry : wt.getEntries ()) {
@@ -2592,14 +2592,15 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
25922592 IRGen.ensureRelativeSymbolCollocation (*wt);
25932593
25942594 auto conf = wt->getConformance ();
2595+ RootProtocolConformance *rootConf = conf->getRootConformance ();
25952596 PrettyStackTraceConformance _st (" emitting witness table for" , conf);
25962597
25972598 unsigned tableSize = 0 ;
25982599 llvm::GlobalVariable *global = nullptr ;
25992600 llvm::Function *instantiationFunction = nullptr ;
2600- bool isDependent = isDependentConformance (conf );
2601+ bool isDependent = isDependentConformance (rootConf );
26012602 SmallVector<llvm::Constant *, 4 > resilientWitnesses;
2602- bool isResilient = isResilientConformance (conf );
2603+ bool isResilient = isResilientConformance (rootConf );
26032604 bool useRelativeProtocolWitnessTable =
26042605 IRGen.Opts .UseRelativeProtocolWitnessTables ;
26052606 if (useRelativeProtocolWitnessTable &&
@@ -2659,7 +2660,7 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) {
26592660 // Collect the information that will go into the protocol conformance
26602661 // descriptor.
26612662 unsigned tablePrivateSize = wt->getConditionalConformances ().size ();
2662- ConformanceDescription description (conf , wt, global, tableSize,
2663+ ConformanceDescription description (rootConf , wt, global, tableSize,
26632664 tablePrivateSize, isDependent);
26642665
26652666 // Build the instantiation function, we if need one.
0 commit comments