mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Make it possible to mark SILFunction as referenced by metainformation
This marker can be used e.g. when a function is referenced from the generic specialization information (or any other kind of metadata) to indicate that this SIL function should not be completely eliminated by the dead function elimination pass even if it is not referenced by any function_ref instruction anymore. Such a function will be preserved in a zombie list instead if it needs to be eliminated.
This commit is contained in:
@@ -557,8 +557,9 @@ void SILModule::removeFromZombieList(StringRef Name) {
|
||||
void SILModule::eraseFunction(SILFunction *F) {
|
||||
|
||||
assert(! F->isZombie() && "zombie function is in list of alive functions");
|
||||
if (F->isInlined() || F->isExternallyUsedSymbol()) {
|
||||
|
||||
if (F->isInlined() || F->isExternallyUsedSymbol() ||
|
||||
F->isReferencedByMetainformation()) {
|
||||
|
||||
// The owner of the function's Name is the FunctionTable key. As we remove
|
||||
// the function from the table we have to store the name string elsewhere:
|
||||
// in zombieFunctionNames.
|
||||
|
||||
Reference in New Issue
Block a user