mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[deserialization] Change SILLinking to use SILModule for linking instead of performing the linking itself.
This approach will allow us to go back to doing lazy linking if we want to in the future. Swift SVN r15498
This commit is contained in:
@@ -340,12 +340,14 @@ public:
|
||||
if (Mode == LinkingMode::LinkNone)
|
||||
return false;
|
||||
|
||||
auto NewFn = Loader->lookupSILFunction(F);
|
||||
// If F is a declaration, first deserialize it.
|
||||
auto NewFn = F->isExternalDeclaration() ? Loader->lookupSILFunction(F) : F;
|
||||
if (!NewFn || NewFn->empty())
|
||||
return false;
|
||||
|
||||
++NumFuncLinked;
|
||||
|
||||
// Transitively deserialize everything referenced by NewFn.
|
||||
Worklist.push_back(NewFn);
|
||||
while (!Worklist.empty()) {
|
||||
auto Fn = Worklist.pop_back_val();
|
||||
@@ -448,3 +450,11 @@ private:
|
||||
bool SILModule::linkFunction(SILFunction *Fun, SILModule::LinkingMode Mode) {
|
||||
return SILLinkerVisitor(SILLoader, Mode, ExternalSource).process(Fun);
|
||||
}
|
||||
|
||||
void SILModule::linkAllWitnessTables() {
|
||||
SILLoader->getAllWitnessTables();
|
||||
}
|
||||
|
||||
void SILModule::linkAllVTables() {
|
||||
SILLoader->getAllVTables();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user