[deserialization] Enable lazy deserialization of witness tables.

This patch adds in the necessary infrastructure for lazily deserializing
witness tables. This is done by following the same approach as the
deserialization/serialization of SILFunction.

Now if one calls SILModule::lookUpWitnessTable and the given witness table is a
definition, the SILModule will attempt to deserialize it from one of the other
modules.

Swift SVN r15403
This commit is contained in:
Michael Gottesman
2014-03-24 09:16:09 +00:00
parent 59a44ca1f2
commit f4bb049bfc
8 changed files with 140 additions and 50 deletions

View File

@@ -58,6 +58,13 @@ SILVTable *SerializedSILLoader::lookupVTable(Identifier Name) {
return nullptr;
}
SILWitnessTable *SerializedSILLoader::lookupWitnessTable(SILWitnessTable *WT) {
for (auto &Des : LoadedSILSections)
if (auto wT = Des->lookupWitnessTable(WT))
return wT;
return nullptr;
}
void SerializedSILLoader::getAll() {
for (auto &Des : LoadedSILSections)
Des->getAll();