mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user