mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Always put SILFunctions into a zombie list, when they are erased.
This removes the function body, but preserves the SILFunction object, which may be still referenced by different kinds of meta-information e.g. debug info for inlined functions, generic specializations information, etc. Doing this unconditionally simplifies the code and makes it less error-prone to reference SILFunctions from any kind of meta-information. It just works. No need to set any special flags, etc.
This commit is contained in:
@@ -2231,13 +2231,7 @@ void KeyPathInst::dropReferencedPattern() {
|
||||
|
||||
GenericSpecializationInformation::GenericSpecializationInformation(
|
||||
SILFunction *Caller, SILFunction *Parent, SubstitutionList Subs)
|
||||
: Caller(Caller), Parent(Parent), Subs(Subs) {
|
||||
// Specialization information may reference these functions, even
|
||||
// if they are removed by means of e.g. dead function elimination.
|
||||
if (Caller)
|
||||
Caller->setReferencedByMetainformation();
|
||||
Parent->setReferencedByMetainformation();
|
||||
}
|
||||
: Caller(Caller), Parent(Parent), Subs(Subs) {}
|
||||
|
||||
const GenericSpecializationInformation *
|
||||
GenericSpecializationInformation::create(SILFunction *Caller,
|
||||
|
||||
Reference in New Issue
Block a user