[serialization] Stop eagerly deserializing decls with conversion functions.

There shouldn't ever be a reason to do this: if a conversion function is
ever selected by the type-checker, it's because the type the conversion
lives on was suggested by another constraint, which means we can do a
normal lookup for the conversion function.

This is actually the only thing being eagerly deserialized, so remove the
notion of eager deserialization altogether.

Swift SVN r11220
This commit is contained in:
Jordan Rose
2013-12-12 23:31:16 +00:00
parent c2bd6eb2b0
commit f29f083fcb
4 changed files with 2 additions and 22 deletions

View File

@@ -151,8 +151,6 @@ static Optional<KnownProtocolKind> getActualKnownProtocol(unsigned rawKind) {
#define PROTOCOL(Id) \
case index_block::Id: return KnownProtocolKind::Id;
#include "swift/AST/KnownProtocols.def"
case index_block::FORCE_DESERIALIZATION:
llvm_unreachable("must handle FORCE_DESERIALIZATION explicitly");
}
// If there's a new case value in the module file, ignore it.
@@ -181,9 +179,7 @@ bool ModuleFile::readKnownProtocolsBlock(llvm::BitstreamCursor &cursor) {
unsigned rawKind = cursor.readRecord(next.ID, scratch);
DeclIDVector *list;
if (rawKind == index_block::FORCE_DESERIALIZATION) {
list = &EagerDeserializationDecls;
} else if (auto actualKind = getActualKnownProtocol(rawKind)) {
if (auto actualKind = getActualKnownProtocol(rawKind)) {
auto index = static_cast<unsigned>(actualKind.getValue());
list = &KnownProtocolAdopters[index];
} else {
@@ -531,13 +527,6 @@ bool ModuleFile::associateWithFileContext(FileUnit *file) {
return false;
}
// Process decls we know we want to eagerly deserialize.
for (DeclID DID : EagerDeserializationDecls) {
Decl *decl = getDecl(DID);
if (auto nominal = getAnyNominal(decl))
loadExtensions(nominal);
}
return Status == ModuleStatus::Valid;
}