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:
Arnold Schwaighofer
2016-02-15 12:14:52 -08:00
parent 1e2285935f
commit 525f8ecbe1
3 changed files with 16 additions and 0 deletions

View File

@@ -95,6 +95,8 @@ SILFunction::SILFunction(SILModule &Module, SILLinkage Linkage,
else
Module.functions.push_back(this);
Module.removeFromZombieList(Name);
// Set our BB list to have this function as its parent. This enables us to
// splice efficiently basic blocks in between functions.
BlockList.Parent = this;