@@ -948,7 +948,8 @@ namespace {
948
948
949
949
// / Return true if the witness table requires runtime instantiation to
950
950
// / handle resiliently-added requirements with default implementations.
951
- static bool isResilientConformance (const NormalProtocolConformance *conformance) {
951
+ bool IRGenModule::isResilientConformance (
952
+ const NormalProtocolConformance *conformance) {
952
953
// If the protocol is not resilient, the conformance is not resilient
953
954
// either.
954
955
if (!conformance->getProtocol ()->isResilient ())
@@ -964,7 +965,7 @@ static bool isResilientConformance(const NormalProtocolConformance *conformance)
964
965
return true ;
965
966
}
966
967
967
- static bool isResilientConformance (const RootProtocolConformance *root) {
968
+ bool IRGenModule:: isResilientConformance (const RootProtocolConformance *root) {
968
969
if (auto normal = dyn_cast<NormalProtocolConformance>(root))
969
970
return isResilientConformance (normal);
970
971
// Self-conformances never require this.
@@ -997,6 +998,7 @@ static bool hasDependentTypeWitness(
997
998
}
998
999
999
1000
static bool isDependentConformance (
1001
+ IRGenModule &IGM,
1000
1002
const RootProtocolConformance *rootConformance,
1001
1003
bool considerResilience,
1002
1004
llvm::SmallPtrSet<const NormalProtocolConformance *, 4 > &visited){
@@ -1011,7 +1013,7 @@ static bool isDependentConformance(
1011
1013
return false ;
1012
1014
1013
1015
// If the conformance is resilient, this is always true.
1014
- if (considerResilience && isResilientConformance (conformance))
1016
+ if (considerResilience && IGM. isResilientConformance (conformance))
1015
1017
return true ;
1016
1018
1017
1019
// Check whether any of the conformances are dependent.
@@ -1027,7 +1029,8 @@ static bool isDependentConformance(
1027
1029
auto assocConformance =
1028
1030
conformance->getAssociatedConformance (req.getFirstType (), assocProtocol);
1029
1031
if (assocConformance.isAbstract () ||
1030
- isDependentConformance (assocConformance.getConcrete ()
1032
+ isDependentConformance (IGM,
1033
+ assocConformance.getConcrete ()
1031
1034
->getRootConformance (),
1032
1035
considerResilience,
1033
1036
visited))
@@ -1045,10 +1048,12 @@ static bool isDependentConformance(
1045
1048
1046
1049
// / Is there anything about the given conformance that requires witness
1047
1050
// / tables to be dependently-generated?
1048
- static bool isDependentConformance (const RootProtocolConformance *conformance,
1049
- bool considerResilience) {
1051
+ bool IRGenModule::isDependentConformance (
1052
+ const RootProtocolConformance *conformance,
1053
+ bool considerResilience) {
1050
1054
llvm::SmallPtrSet<const NormalProtocolConformance *, 4 > visited;
1051
- return ::isDependentConformance (conformance, considerResilience, visited);
1055
+ return ::isDependentConformance (*this , conformance, considerResilience,
1056
+ visited);
1052
1057
}
1053
1058
1054
1059
static bool isSynthesizedNonUnique (const RootProtocolConformance *conformance) {
@@ -1286,7 +1291,7 @@ class AccessorConformanceInfo : public ConformanceInfo {
1286
1291
Conformance.getDeclContext())),
1287
1292
SILEntries(SILWT->getEntries ()),
1288
1293
SILConditionalConformances(SILWT->getConditionalConformances ()),
1289
- ResilientConformance(isResilientConformance(&Conformance)),
1294
+ ResilientConformance(IGM. isResilientConformance(&Conformance)),
1290
1295
PI(IGM.getProtocolInfo(SILWT->getConformance ()->getProtocol(),
1291
1296
(ResilientConformance
1292
1297
? ProtocolInfoKind::RequirementSignature
@@ -2086,7 +2091,7 @@ void IRGenerator::ensureRelativeSymbolCollocation(SILWitnessTable &wt) {
2086
2091
2087
2092
// Only resilient conformances use relative pointers for witness methods.
2088
2093
if (wt.isDeclaration () || isAvailableExternally (wt.getLinkage ()) ||
2089
- !isResilientConformance (wt.getConformance ()))
2094
+ !CurrentIGM-> isResilientConformance (wt.getConformance ()))
2090
2095
return ;
2091
2096
2092
2097
for (auto &entry : wt.getEntries ()) {
0 commit comments