Skip to content

Commit c9ea70e

Browse files
committed
Sema: Remove TypeChecker::markConformanceUsed()
1 parent 3e0cd23 commit c9ea70e

File tree

4 files changed

+0
-35
lines changed

4 files changed

+0
-35
lines changed

include/swift/AST/LazyResolver.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ class LazyResolver {
7474

7575
/// Resolve an implicitly-generated member with the given name.
7676
virtual void resolveImplicitMember(NominalTypeDecl *nominal, DeclName member) = 0;
77-
78-
/// Mark the given conformance as "used" from the given declaration context.
79-
virtual void markConformanceUsed(ProtocolConformanceRef conformance,
80-
DeclContext *dc) = 0;
8177
};
8278

8379
class LazyMemberLoader;

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,19 +4240,6 @@ ModuleDecl::conformsToProtocol(Type sourceTy, ProtocolDecl *targetProtocol) {
42404240
return TypeChecker::conformsToProtocol(sourceTy, targetProtocol, this, flags);
42414241
}
42424242

4243-
void TypeChecker::markConformanceUsed(ProtocolConformanceRef conformance,
4244-
DeclContext *dc) {
4245-
if (conformance.isAbstract()) return;
4246-
4247-
if (auto normalConformance =
4248-
dyn_cast<NormalProtocolConformance>(
4249-
conformance.getConcrete()->getRootConformance())) {;
4250-
// Make sure that the type checker completes this conformance.
4251-
if (normalConformance->isIncomplete())
4252-
UsedConformances.insert(normalConformance);
4253-
}
4254-
}
4255-
42564243
Optional<ProtocolConformanceRef>
42574244
TypeChecker::LookUpConformance::operator()(
42584245
CanType dependentType,

lib/Sema/TypeChecker.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -356,19 +356,10 @@ static void typeCheckFunctionsAndExternalDecls(SourceFile &SF, TypeChecker &TC)
356356
}
357357
TC.PartiallyCheckedConformances.clear();
358358

359-
// Complete any conformances that we used.
360-
for (unsigned i = 0; i != TC.UsedConformances.size(); ++i) {
361-
auto conformance = TC.UsedConformances[i];
362-
if (conformance->isIncomplete())
363-
TC.checkConformance(conformance);
364-
}
365-
TC.UsedConformances.clear();
366-
367359
} while (currentFunctionIdx < TC.definedFunctions.size() ||
368360
currentSynthesizedDecl < SF.SynthesizedDecls.size() ||
369361
TC.NextDeclToFinalize < TC.DeclsToFinalize.size() ||
370362
!TC.ConformanceContexts.empty() ||
371-
!TC.UsedConformances.empty() ||
372363
!TC.PartiallyCheckedConformances.empty());
373364

374365
// FIXME: Horrible hack. Store this somewhere more appropriate.

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,6 @@ class TypeChecker final : public LazyResolver {
547547
/// Declarations that need their conformances checked.
548548
llvm::SmallVector<Decl *, 8> ConformanceContexts;
549549

550-
/// The list of protocol conformances that were "used" and will need to be
551-
/// completed before type checking is considered complete.
552-
llvm::SetVector<NormalProtocolConformance *> UsedConformances;
553-
554550
/// The list of protocol conformances whose requirements could not be
555551
/// fully checked and, therefore, should be checked again at the top
556552
/// level.
@@ -1652,11 +1648,6 @@ class TypeChecker final : public LazyResolver {
16521648
ConformanceCheckOptions options,
16531649
SourceLoc ComplainLoc = SourceLoc());
16541650

1655-
/// Mark the given protocol conformance as "used" from the given declaration
1656-
/// context.
1657-
void markConformanceUsed(ProtocolConformanceRef conformance,
1658-
DeclContext *dc) override final;
1659-
16601651
/// Functor class suitable for use as a \c LookupConformanceFn to look up a
16611652
/// conformance through a particular declaration context using the given
16621653
/// type checker.

0 commit comments

Comments
 (0)