Skip to content

Commit 34db837

Browse files
authored
Merge pull request #42453 from xedin/retain-replaced-func
[SILOpt] Make sure that dynamically replaced function is kept alive
2 parents 1546a59 + d36822e commit 34db837

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SILOptimizer/IPO/DeadFunctionElimination.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ class DeadFunctionAndGlobalElimination {
328328

329329
LLVM_DEBUG(llvm::dbgs() << " scan function " << F->getName() << '\n');
330330

331+
if (auto *replacedFn = F->getDynamicallyReplacedFunction())
332+
ensureAlive(replacedFn);
333+
331334
if (auto *adHocWitness = F->getReferencedAdHocRequirementWitnessFunction())
332335
ensureAlive(adHocWitness);
333336

0 commit comments

Comments
 (0)