Skip to content

Commit b146911

Browse files
committed
Revert "SILCloner: allow builtin conformances"
This reverts commit abae144.
1 parent 986e871 commit b146911

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

include/swift/AST/Type.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,6 @@ class MakeAbstractConformanceForGenericType {
126126
ProtocolDecl *conformedProtocol) const;
127127
};
128128

129-
/// Functor class suitable for use as a \c LookupConformanceFn that provides
130-
/// only abstract conformances, or builtin conformances for invertible protocols
131-
/// for generic types. Asserts that the replacement
132-
/// type is an opaque generic type.
133-
class MakeAbstractOrBuiltinConformanceForGenericType {
134-
public:
135-
ProtocolConformanceRef operator()(CanType dependentType,
136-
Type conformingReplacementType,
137-
ProtocolDecl *conformedProtocol) const;
138-
};
139-
140129
/// Functor class suitable for use as a \c LookupConformanceFn that fetches
141130
/// conformances from a generic signature.
142131
class LookUpConformanceInSignature {

include/swift/SIL/SILCloner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
196196
// If we found a type containing a local archetype, substitute
197197
// open existentials throughout the substitution map.
198198
Subs = Subs.subst(QueryTypeSubstitutionMapOrIdentity{LocalArchetypeSubs},
199-
MakeAbstractOrBuiltinConformanceForGenericType());
199+
MakeAbstractConformanceForGenericType());
200200
}
201201
}
202202

@@ -219,7 +219,7 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
219219
return Ty.subst(
220220
Builder.getModule(),
221221
QueryTypeSubstitutionMapOrIdentity{LocalArchetypeSubs},
222-
MakeAbstractOrBuiltinConformanceForGenericType(),
222+
MakeAbstractConformanceForGenericType(),
223223
CanGenericSignature());
224224
}
225225
SILType getOpType(SILType Ty) {
@@ -239,7 +239,7 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
239239

240240
return ty.subst(
241241
QueryTypeSubstitutionMapOrIdentity{LocalArchetypeSubs},
242-
MakeAbstractOrBuiltinConformanceForGenericType()
242+
MakeAbstractConformanceForGenericType()
243243
)->getCanonicalType();
244244
}
245245

@@ -352,7 +352,7 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
352352
conformance.subst(ty,
353353
QueryTypeSubstitutionMapOrIdentity{
354354
LocalArchetypeSubs},
355-
MakeAbstractOrBuiltinConformanceForGenericType());
355+
MakeAbstractConformanceForGenericType());
356356
}
357357

358358
return asImpl().remapConformance(getASTTypeInClonedContext(ty),

lib/AST/TypeSubstitution.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -230,22 +230,6 @@ operator()(CanType dependentType, Type conformingReplacementType,
230230
return Subs.lookupConformance(dependentType, conformedProtocol);
231231
}
232232

233-
ProtocolConformanceRef MakeAbstractOrBuiltinConformanceForGenericType::
234-
operator()(CanType dependentType, Type conformingReplacementType,
235-
ProtocolDecl *conformedProtocol) const {
236-
// Workaround for rdar://125460667
237-
if (conformedProtocol->getInvertibleProtocolKind()) {
238-
auto &ctx = conformedProtocol->getASTContext();
239-
return ProtocolConformanceRef(
240-
ctx.getBuiltinConformance(conformingReplacementType, conformedProtocol,
241-
BuiltinConformanceKind::Synthesized));
242-
}
243-
244-
return MakeAbstractConformanceForGenericType()(dependentType,
245-
conformingReplacementType,
246-
conformedProtocol);
247-
}
248-
249233
ProtocolConformanceRef MakeAbstractConformanceForGenericType::
250234
operator()(CanType dependentType, Type conformingReplacementType,
251235
ProtocolDecl *conformedProtocol) const {

0 commit comments

Comments
 (0)