mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Update the zombie function list if we create new functions
Dead function elimination deletes functions making them zombies. A zombie is a function whose name only exists because debug info might still refer to it. However, later passes of specialization might create a new function by the same name again. We now have a zombie function (which is just an alias to a deleted method stub) and a function definition. No test case since I could not reduce this to a small test case. rdar://24659988
This commit is contained in:
@@ -512,6 +512,13 @@ void SILModule::invalidateSILLoaderCaches() {
|
||||
getSILLoader()->invalidateCaches();
|
||||
}
|
||||
|
||||
void SILModule::removeFromZombieList(StringRef Name) {
|
||||
if (auto *Zombie = ZombieFunctionTable.lookup(Name)) {
|
||||
ZombieFunctionTable.erase(Name);
|
||||
zombieFunctions.remove(Zombie);
|
||||
}
|
||||
}
|
||||
|
||||
/// Erase a function from the module.
|
||||
void SILModule::eraseFunction(SILFunction *F) {
|
||||
|
||||
@@ -529,6 +536,7 @@ void SILModule::eraseFunction(SILFunction *F) {
|
||||
// or vtable stub generation. So we move it into the zombie list.
|
||||
getFunctionList().remove(F);
|
||||
zombieFunctions.push_back(F);
|
||||
ZombieFunctionTable[copiedName] = F;
|
||||
F->setZombie();
|
||||
|
||||
// This opens dead-function-removal opportunities for called functions.
|
||||
|
||||
Reference in New Issue
Block a user