File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
361
361
// If the function was newly created with an empty body mark it as
362
362
// undead.
363
363
if (ParentFunction->empty ()) {
364
- M .eraseFunction (ParentFunction);
364
+ FuncBuilder .eraseFunction (ParentFunction);
365
365
ParentFunction->setGenericEnvironment (OriginalEnvironment);
366
366
}
367
367
}
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ class SILOptFunctionBuilder {
49
49
return f;
50
50
}
51
51
52
+ void eraseFunction (SILFunction *f) {
53
+ auto &pm = getPassManager ();
54
+ pm.notifyWillDeleteFunction (f);
55
+ pm.getModule ()->eraseFunction (f);
56
+ }
57
+
52
58
private:
53
59
SILPassManager &getPassManager () const {
54
60
return *transform.getPassManager ();
Original file line number Diff line number Diff line change @@ -676,10 +676,8 @@ class MandatoryInlining : public SILModuleTransform {
676
676
if (F.getRepresentation () == SILFunctionTypeRepresentation::ObjCMethod)
677
677
continue ;
678
678
679
- notifyWillDeleteFunction (&F);
680
-
681
679
// Okay, just erase the function from the module.
682
- M-> eraseFunction (&F);
680
+ FuncBuilder. eraseFunction (&F);
683
681
}
684
682
}
685
683
You can’t perform that action at this time.
0 commit comments