Skip to content

Commit 8e50f1f

Browse files
committed
AST: Rename mapTypeIntoContext() => mapTypeIntoEnvironment(), mapTypeOutOfContext() => mapTypeOutOfEnvironment()
1 parent 303432d commit 8e50f1f

File tree

179 files changed

+674
-674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+674
-674
lines changed

SwiftCompilerSources/Sources/AST/GenericSignature.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public struct GenericSignature: CustomStringConvertible, NoReflectionChildren {
3030
TypeArray(bridged: bridged.getGenericParams())
3131
}
3232

33-
public func mapTypeIntoContext(_ type: Type) -> Type {
34-
Type(bridged: bridged.mapTypeIntoContext(type.bridged))
33+
public func mapTypeIntoEnvironment(_ type: Type) -> Type {
34+
Type(bridged: bridged.mapTypeIntoEnvironment(type.bridged))
3535
}
3636

3737
public var isEmpty: Bool { bridged.impl == nil }

SwiftCompilerSources/Sources/SIL/Function.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
8686
SubstitutionMap(bridged: bridged.getForwardingSubstitutionMap())
8787
}
8888

89-
public func mapTypeIntoContext(_ type: AST.`Type`) -> AST.`Type` {
90-
return AST.`Type`(bridged: bridged.mapTypeIntoContext(type.bridged))
89+
public func mapTypeIntoEnvironment(_ type: AST.`Type`) -> AST.`Type` {
90+
return AST.`Type`(bridged: bridged.mapTypeIntoEnvironment(type.bridged))
9191
}
9292

9393
/// Returns true if the function is a definition and not only an external declaration.

SwiftCompilerSources/Sources/SIL/Type.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public struct Type : TypeProperties, CustomStringConvertible, NoReflectionChildr
144144
public var hasValidSignatureForEmbedded: Bool {
145145
let genericSignature = invocationGenericSignatureOfFunction
146146
for genParam in genericSignature.genericParameters {
147-
let mappedParam = genericSignature.mapTypeIntoContext(genParam)
147+
let mappedParam = genericSignature.mapTypeIntoEnvironment(genParam)
148148
if mappedParam.isArchetype && !mappedParam.archetypeRequiresClass {
149149
return false
150150
}

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3074,7 +3074,7 @@ struct BridgedGenericSignature {
30743074
BRIDGED_INLINE swift::GenericSignature unbridged() const;
30753075
BridgedOwnedString getDebugDescription() const;
30763076
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTTypeArray getGenericParams() const;
3077-
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeIntoContext(BridgedASTType type) const;
3077+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType mapTypeIntoEnvironment(BridgedASTType type) const;
30783078
};
30793079

30803080
struct BridgedFingerprint {

include/swift/AST/ASTBridgingImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ BridgedASTTypeArray BridgedGenericSignature::getGenericParams() const {
869869
return {unbridged().getGenericParams()};
870870
}
871871

872-
BridgedASTType BridgedGenericSignature::mapTypeIntoContext(BridgedASTType type) const {
873-
return {unbridged().getGenericEnvironment()->mapTypeIntoContext(type.unbridged()).getPointer()};
872+
BridgedASTType BridgedGenericSignature::mapTypeIntoEnvironment(BridgedASTType type) const {
873+
return {unbridged().getGenericEnvironment()->mapTypeIntoEnvironment(type.unbridged()).getPointer()};
874874
}
875875

876876
//===----------------------------------------------------------------------===//

include/swift/AST/AnyFunctionRef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class AnyFunctionRef {
9696
Type getBodyResultType() const {
9797
if (auto *AFD = TheFunction.dyn_cast<AbstractFunctionDecl *>()) {
9898
if (auto *FD = dyn_cast<FuncDecl>(AFD))
99-
return FD->mapTypeIntoContext(FD->getResultInterfaceType());
99+
return FD->mapTypeIntoEnvironment(FD->getResultInterfaceType());
100100
return TupleType::getEmpty(AFD->getASTContext());
101101
}
102102
return cast<AbstractClosureExpr *>(TheFunction)->getResultType();
@@ -308,7 +308,7 @@ class AnyFunctionRef {
308308
auto valueTy = AD->getStorage()->getValueInterfaceType()
309309
->getReferenceStorageReferent();
310310
if (mapIntoContext)
311-
valueTy = AD->mapTypeIntoContext(valueTy);
311+
valueTy = AD->mapTypeIntoEnvironment(valueTy);
312312
YieldTypeFlags flags(isYieldingMutableAccessor(AD->getAccessorKind())
313313
? ParamSpecifier::InOut
314314
: ParamSpecifier::LegacyShared);

include/swift/AST/DeclContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class alignas(1 << DeclContextAlignInBits) DeclContext
441441
GenericEnvironment *getGenericEnvironmentOfContext() const;
442442

443443
/// Map an interface type to a contextual type within this context.
444-
Type mapTypeIntoContext(Type type) const;
444+
Type mapTypeIntoEnvironment(Type type) const;
445445

446446
/// Returns this or the first local parent context, or nullptr if it is not
447447
/// contained in one.

include/swift/AST/GenericEnvironment.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ struct ElementEnvironmentData {
7575
/// Describes the mapping between archetypes and interface types for the
7676
/// generic parameters of a DeclContext.
7777
///
78-
/// The most frequently used method here is mapTypeIntoContext(), which
78+
/// The most frequently used method here is mapTypeIntoEnvironment(), which
7979
/// maps an interface type to a type written in terms of the generic
8080
/// environment's archetypes; to go in the other direction, use
81-
/// TypeBase::mapTypeOutOfContext().
81+
/// TypeBase::mapTypeOutOfEnvironment().
8282
///
8383
class alignas(1 << DeclAlignInBits) GenericEnvironment final
8484
: private llvm::TrailingObjects<
@@ -279,14 +279,14 @@ class alignas(1 << DeclAlignInBits) GenericEnvironment final
279279
Type maybeApplyOuterContextSubstitutions(Type type) const;
280280

281281
/// Map an interface type to a contextual type.
282-
static Type mapTypeIntoContext(GenericEnvironment *genericEnv,
282+
static Type mapTypeIntoEnvironment(GenericEnvironment *genericEnv,
283283
Type type);
284284

285285
/// Map an interface type to a contextual type.
286-
Type mapTypeIntoContext(Type type) const;
286+
Type mapTypeIntoEnvironment(Type type) const;
287287

288288
/// Map a generic parameter type to a contextual type.
289-
Type mapTypeIntoContext(GenericTypeParamType *type) const;
289+
Type mapTypeIntoEnvironment(GenericTypeParamType *type) const;
290290

291291
/// Map a type parameter type to a contextual type.
292292
Type getOrCreateArchetypeFromInterfaceType(Type depType);
@@ -327,7 +327,7 @@ class alignas(1 << DeclAlignInBits) GenericEnvironment final
327327
///
328328
/// This operation will also reabstract dependent types according to the
329329
/// abstraction level of their associated type requirements.
330-
SILType mapTypeIntoContext(SILModule &M, SILType type) const;
330+
SILType mapTypeIntoEnvironment(SILModule &M, SILType type) const;
331331

332332
/// Returns a substitution map that sends every generic parameter to its
333333
/// corresponding archetype in this generic environment.

include/swift/AST/TypeTransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ case TypeKind::Id:
184184

185185
auto *newEnv = GenericEnvironment::forOpenedExistential(
186186
genericSig, existentialTy, newSubMap, uuid);
187-
return newEnv->mapTypeIntoContext(local->getInterfaceType());
187+
return newEnv->mapTypeIntoEnvironment(local->getInterfaceType());
188188
}
189189

190190
case TypeKind::ElementArchetype: {

include/swift/AST/Types.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ class alignas(1 << TypeAlignInBits) TypeBase
842842
Type addCurriedSelfType(const DeclContext *dc);
843843

844844
/// Map a contextual type to an interface type.
845-
Type mapTypeOutOfContext();
845+
Type mapTypeOutOfEnvironment();
846846

847847
/// Compute and return the set of type variables that occur within this
848848
/// type.
@@ -4774,8 +4774,8 @@ class SILParameterInfo {
47744774
return getWithInterfaceType(fn(getInterfaceType()));
47754775
}
47764776

4777-
SILParameterInfo mapTypeOutOfContext() const {
4778-
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfContext()
4777+
SILParameterInfo mapTypeOutOfEnvironment() const {
4778+
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfEnvironment()
47794779
->getCanonicalType());
47804780
}
47814781

@@ -5047,8 +5047,8 @@ class SILResultInfo {
50475047
return getWithInterfaceType(fn(getInterfaceType()));
50485048
}
50495049

5050-
SILResultInfo mapTypeOutOfContext() const {
5051-
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfContext()
5050+
SILResultInfo mapTypeOutOfEnvironment() const {
5051+
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfEnvironment()
50525052
->getCanonicalType());
50535053
}
50545054

@@ -5114,8 +5114,8 @@ class SILYieldInfo : public SILParameterInfo {
51145114
return getWithInterfaceType(fn(getInterfaceType()));
51155115
}
51165116

5117-
SILYieldInfo mapTypeOutOfContext() const {
5118-
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfContext()
5117+
SILYieldInfo mapTypeOutOfEnvironment() const {
5118+
return getWithInterfaceType(getInterfaceType()->mapTypeOutOfEnvironment()
51195119
->getCanonicalType());
51205120
}
51215121

0 commit comments

Comments
 (0)