[embedded] Avoid changing lookupStdlibFunction, load findStringSwitchCaseWithCache in MPO instead

This commit is contained in:
Kuba Mracek
2025-01-28 10:03:14 -08:00
parent 92b0c5f5d0
commit e1d22b5076
3 changed files with 11 additions and 6 deletions

View File

@@ -86,7 +86,8 @@ private func optimize(function: Function, _ context: FunctionPassContext, _ modu
// eagerly linking and specializing _findStringSwitchCaseWithCache whenever findStringSwitchCase is found in the module.
if context.options.enableEmbeddedSwift {
if function.hasSemanticsAttribute("findStringSwitchCase"),
let f = context.lookupStdlibFunction(name: "_findStringSwitchCaseWithCache") {
let f = context.lookupStdlibFunction(name: "_findStringSwitchCaseWithCache"),
context.loadFunction(function: f, loadCalleesRecursively: true) {
worklist.pushIfNotVisited(f)
}
}