Skip to content

Commit 9393a11

Browse files
committed
AST: Rename mapConformanceOutOfContext() => mapConformanceOutOfEnvironment(), mapReplacementTypesOutOfContext() => subs.mapReplacementTypesOutOfEnvironment()
1 parent 8e50f1f commit 9393a11

14 files changed

+20
-20
lines changed

include/swift/AST/ProtocolConformanceRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class ProtocolConformanceRef {
199199
ProtocolConformanceRef subst(InFlightSubstitution &IFS) const;
200200

201201
/// Map contextual types to interface types in the conformance.
202-
ProtocolConformanceRef mapConformanceOutOfContext() const;
202+
ProtocolConformanceRef mapConformanceOutOfEnvironment() const;
203203

204204
/// Look up the type witness for an associated type declaration in this
205205
/// conformance.

include/swift/AST/SubstitutionMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class SubstitutionMap {
209209

210210
/// Swap archetypes in the substitution map's replacement types with their
211211
/// interface types.
212-
SubstitutionMap mapReplacementTypesOutOfContext() const;
212+
SubstitutionMap mapReplacementTypesOutOfEnvironment() const;
213213

214214
/// Verify that the conformances stored in this substitution map match the
215215
/// replacement types provided.

include/swift/SIL/TypeSubstCloner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
416416
});
417417
}
418418

419-
SubsMap = SubsMap.mapReplacementTypesOutOfContext();
419+
SubsMap = SubsMap.mapReplacementTypesOutOfEnvironment();
420420
}
421421

422422
// One abstract function in the debug info can only have one set of variables
@@ -427,7 +427,7 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
427427
!SubsMap.getRecursiveProperties().hasTypeParameter())
428428
return ParentFunction;
429429

430-
// Note that mapReplacementTypesOutOfContext() can't do anything for
430+
// Note that mapReplacementTypesOutOfEnvironment() can't do anything for
431431
// opened existentials, and since archetypes can't be mangled, ignore
432432
// this case for now.
433433
if (SubsMap.getRecursiveProperties().hasLocalArchetype())

lib/AST/ProtocolConformanceRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ProtocolConformanceRef::subst(InFlightSubstitution &IFS) const {
114114
return IFS.lookupConformance(origType, proto, /*level=*/0);
115115
}
116116

117-
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() const {
117+
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfEnvironment() const {
118118
if (isConcrete()) {
119119
return getConcrete()->subst(
120120
MapTypeOutOfContext(),

lib/AST/SubstitutionMap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
290290
return conformance;
291291
}
292292

293-
SubstitutionMap SubstitutionMap::mapReplacementTypesOutOfContext() const {
293+
SubstitutionMap SubstitutionMap::mapReplacementTypesOutOfEnvironment() const {
294294
return subst(MapTypeOutOfContext(),
295295
LookUpConformanceInModule(),
296296
SubstFlags::PreservePackExpansionLevel |
@@ -419,7 +419,7 @@ OverrideSubsInfo::OverrideSubsInfo(const NominalTypeDecl *baseNominal,
419419
BaseSubMap = derivedNominalTy->getContextSubstitutionMap(
420420
baseNominal, genericEnv);
421421

422-
BaseSubMap = BaseSubMap.mapReplacementTypesOutOfContext();
422+
BaseSubMap = BaseSubMap.mapReplacementTypesOutOfEnvironment();
423423
}
424424

425425
if (auto derivedNominalSig = derivedNominal->getGenericSignature())

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ SILParser::parseKeyPathPatternComponent(KeyPathPatternComponent &component,
25092509
// Map the substitutions out of the pattern context so that they
25102510
// use interface types.
25112511
externalSubs =
2512-
externalSubs.mapReplacementTypesOutOfContext().getCanonical();
2512+
externalSubs.mapReplacementTypesOutOfEnvironment().getCanonical();
25132513
}
25142514

25152515
} else {

lib/SILGen/SILGenExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4630,7 +4630,7 @@ static void lowerKeyPathMemberIndexPatterns(
46304630
CanType formalTy;
46314631
SILType loweredTy;
46324632
std::tie(formalTy, loweredTy) = indexTypes[i];
4633-
auto hashable = indexHashables[i].mapConformanceOutOfContext();
4633+
auto hashable = indexHashables[i].mapConformanceOutOfEnvironment();
46344634
assert(hashable.isAbstract() ||
46354635
hashable.getConcrete()->getType()->isEqual(formalTy));
46364636

@@ -4814,7 +4814,7 @@ KeyPathPatternComponent SILGenModule::emitKeyPathComponentForDecl(
48144814
if (externalSubs.getRecursiveProperties().hasArchetype()) {
48154815
needsGenericContext = true;
48164816
// FIXME: This doesn't do anything for local archetypes!
4817-
externalSubs = externalSubs.mapReplacementTypesOutOfContext();
4817+
externalSubs = externalSubs.mapReplacementTypesOutOfEnvironment();
48184818
}
48194819
}
48204820

lib/SILGen/SILGenType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ SILFunction *SILGenModule::emitProtocolWitness(
787787
if (conformance.isConcrete()) {
788788
conformance = reqtSubMap.lookupConformance(M.getASTContext().TheSelfType,
789789
origConformance.getProtocol())
790-
.mapConformanceOutOfContext();
790+
.mapConformanceOutOfEnvironment();
791791
ASSERT(!conformance.isAbstract());
792792

793793
manglingConformance = conformance.getConcrete();
@@ -821,7 +821,7 @@ SILFunction *SILGenModule::emitProtocolWitness(
821821
if (auto accessor = dyn_cast<AccessorDecl>(requirement.getDecl())) {
822822
if (accessor->isCoroutine()) {
823823
witnessSubsForTypeLowering =
824-
witness.getSubstitutions().mapReplacementTypesOutOfContext();
824+
witness.getSubstitutions().mapReplacementTypesOutOfEnvironment();
825825
if (accessor->isRequirementWithSynthesizedDefaultImplementation())
826826
allowDuplicateThunk = true;
827827
}

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4588,7 +4588,7 @@ AssociatedConformanceRequest::evaluate(Evaluator &eval,
45884588
substTy = conformance->getDeclContext()->mapTypeIntoEnvironment(substTy);
45894589

45904590
return lookupConformance(substTy, reqProto, /*allowMissing=*/true)
4591-
.mapConformanceOutOfContext();
4591+
.mapConformanceOutOfEnvironment();
45924592
}
45934593

45944594
TinyPtrVector<AssociatedTypeDecl *>

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9334,7 +9334,7 @@ applySolutionToInitialization(SyntacticElementTarget target, Expr *initializer,
93349334
resultTarget.getAsExpr()->forEachChildExpr([&](Expr *expr) -> Expr * {
93359335
if (auto coercionExpr = dyn_cast<UnderlyingToOpaqueExpr>(expr)) {
93369336
auto newSubstitutions =
9337-
coercionExpr->substitutions.mapReplacementTypesOutOfContext();
9337+
coercionExpr->substitutions.mapReplacementTypesOutOfEnvironment();
93389338
if (substitutions.empty()) {
93399339
substitutions = newSubstitutions;
93409340
} else {

0 commit comments

Comments
 (0)