Remove the tables that track the types that conform to "known" protocols.

The type checker no longer needs them.


Swift SVN r22137
This commit is contained in:
Doug Gregor
2014-09-19 16:41:26 +00:00
parent f0d03efb4c
commit 3119e6d345
10 changed files with 6 additions and 250 deletions

View File

@@ -235,12 +235,6 @@ struct ASTContext::Implementation {
/// \brief The permanent arena.
Arena Permanent;
using ConformanceListPair = std::pair<unsigned, SmallVector<Decl *, 8>>;
/// \brief The set of nominal types and extensions thereof known to conform
/// to compiler-known protocols.
ConformanceListPair KnownProtocolConformances[NumKnownProtocols];
/// Temporary arena used for a constraint solver.
struct ConstraintSolverArena : public Arena {
/// The allocator used for all allocations within this arena.
@@ -1208,28 +1202,6 @@ void ASTContext::setConformsTo(CanType type, ProtocolDecl *proto,
conformsTo[{type, proto}] = entry;
}
void ASTContext::recordConformance(KnownProtocolKind protocolKind, Decl *decl) {
assert(isa<NominalTypeDecl>(decl) || isa<ExtensionDecl>(decl));
auto index = static_cast<unsigned>(protocolKind);
assert(index < NumKnownProtocols);
Impl.KnownProtocolConformances[index].second.push_back(decl);
}
/// \brief Retrieve the set of nominal types and extensions thereof that
/// conform to the given protocol.
ArrayRef<Decl *> ASTContext::getTypesThatConformTo(KnownProtocolKind kind) {
auto index = static_cast<unsigned>(kind);
assert(index < NumKnownProtocols);
for (auto &loader : Impl.ModuleLoaders) {
loader->loadDeclsConformingTo(kind,
Impl.KnownProtocolConformances[index].first);
}
Impl.KnownProtocolConformances[index].first = CurrentGeneration;
return Impl.KnownProtocolConformances[index].second;
}
NormalProtocolConformance *
ASTContext::getConformance(Type conformingType,
ProtocolDecl *protocol,