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