mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Address review feedback
This commit is contained in:
@@ -109,11 +109,6 @@ public:
|
||||
LookupConformanceFn conformances,
|
||||
SubstOptions options = None) const;
|
||||
|
||||
/// Replace opaque types in the conforming type with their underlying types,
|
||||
/// and resolve opaque conformances to their underlying conformances.
|
||||
ProtocolConformanceRef substOpaqueTypesWithUnderlyingTypes(
|
||||
Type origType, ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
/// Given a dependent type (expressed in terms of this conformance's
|
||||
/// protocol), follow it from the conforming type.
|
||||
Type getAssociatedType(Type origType, Type dependentType,
|
||||
|
||||
@@ -175,11 +175,6 @@ public:
|
||||
LookupConformanceFn conformances,
|
||||
SubstOptions options = None) const;
|
||||
|
||||
/// Replace opaque types in the replacement types in the map with their
|
||||
/// underlying types. Does not change keys.
|
||||
SubstitutionMap substOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
/// Create a substitution map for a protocol conformance.
|
||||
static SubstitutionMap
|
||||
getProtocolSubstitutions(ProtocolDecl *protocol,
|
||||
|
||||
@@ -316,11 +316,6 @@ public:
|
||||
/// Replace references to substitutable types with error types.
|
||||
Type substDependentTypesWithErrorTypes() const;
|
||||
|
||||
/// Replace opaque types with their underlying types when visible at the given
|
||||
/// resilience expansion.
|
||||
Type substOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
bool isPrivateStdlibType(bool treatNonBuiltinProtocolsAsPublic = true) const;
|
||||
|
||||
void dump() const;
|
||||
|
||||
@@ -4821,26 +4821,6 @@ private:
|
||||
BEGIN_CAN_TYPE_WRAPPER(OpaqueTypeArchetypeType, ArchetypeType)
|
||||
END_CAN_TYPE_WRAPPER(OpaqueTypeArchetypeType, ArchetypeType)
|
||||
|
||||
/// A function object that can be used as a \c TypeSubstitutionFn and
|
||||
/// \c LookupConformanceFn for \c Type::subst style APIs to map opaque
|
||||
/// archetypes with underlying types visible at a given resilience expansion
|
||||
/// to their underlying types.
|
||||
class ReplaceOpaqueTypesWithUnderlyingTypes {
|
||||
public:
|
||||
ModuleDecl *modulePerformingSubstitution;
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution)
|
||||
: modulePerformingSubstitution(modulePerformingSubstitution) {}
|
||||
|
||||
/// TypeSubstitutionFn
|
||||
Type operator()(SubstitutableType *maybeOpaqueType) const;
|
||||
|
||||
/// LookupConformanceFn
|
||||
Optional<ProtocolConformanceRef> operator()(CanType maybeOpaqueType,
|
||||
Type replacementType,
|
||||
ProtocolDecl *protocol) const;
|
||||
};
|
||||
|
||||
/// An archetype that represents the dynamic type of an opened existential.
|
||||
class OpenedArchetypeType final : public ArchetypeType,
|
||||
private ArchetypeTrailingObjects<OpenedArchetypeType>
|
||||
|
||||
@@ -109,11 +109,7 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
|
||||
|
||||
assert(Subs.empty() ||
|
||||
SubstCalleeSILType ==
|
||||
Callee->getType().substGenericArgs(AI.getModule(), Subs) ||
|
||||
(Cloner.ReplacingOpaqueArchetypes &&
|
||||
SubstCalleeSILType ==
|
||||
Cloner.getOpType(Callee->getType().substGenericArgs(
|
||||
AI.getModule(), Subs))));
|
||||
Callee->getType().substGenericArgs(AI.getModule(), Subs));
|
||||
}
|
||||
|
||||
ArrayRef<SILValue> getArguments() const {
|
||||
@@ -159,14 +155,12 @@ public:
|
||||
TypeSubstCloner(SILFunction &To,
|
||||
SILFunction &From,
|
||||
SubstitutionMap ApplySubs,
|
||||
bool Inlining = false,
|
||||
bool ReplacingOpaqueArchetypes = false)
|
||||
bool Inlining = false)
|
||||
: SILClonerWithScopes<ImplClass>(To, Inlining),
|
||||
SwiftMod(From.getModule().getSwiftModule()),
|
||||
SubsMap(ApplySubs),
|
||||
Original(From),
|
||||
Inlining(Inlining),
|
||||
ReplacingOpaqueArchetypes(ReplacingOpaqueArchetypes) {
|
||||
Inlining(Inlining) {
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -387,8 +381,6 @@ protected:
|
||||
SILFunction &Original;
|
||||
/// True, if used for inlining.
|
||||
bool Inlining;
|
||||
/// True if replacing opaque result archetypes.
|
||||
bool ReplacingOpaqueArchetypes;
|
||||
};
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
Reference in New Issue
Block a user