Fix wrong call graph update when deserializing a vtable.

The callback (which is used for creating CG nodes) was lost when deserializing the functions of a vtable.

Fixes rdar://problem/21609902



Swift SVN r29838
This commit is contained in:
Erik Eckstein
2015-07-01 10:51:59 +00:00
parent 35486db21d
commit 11705b346c
4 changed files with 59 additions and 4 deletions

View File

@@ -542,7 +542,8 @@ void SILModule::eraseFunction(SILFunction *F) {
}
}
SILVTable *SILModule::lookUpVTable(const ClassDecl *C) {
SILVTable *SILModule::lookUpVTable(const ClassDecl *C,
std::function<void(SILFunction *)> Callback) {
if (!C)
return nullptr;
@@ -554,7 +555,8 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C) {
// If that fails, try to deserialize it. If that fails, return nullptr.
SILVTable *Vtbl = SILLinkerVisitor(*this, getSILLoader(),
SILModule::LinkingMode::LinkAll,
ExternalSource).processClassDecl(C);
ExternalSource,
Callback).processClassDecl(C);
if (!Vtbl)
return nullptr;