Skip to content

Commit a3d15b1

Browse files
committed
[embedded] No need to pass isEmbeddedSwift as an explicit argument, use context directly
1 parent f67c660 commit a3d15b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

SwiftCompilerSources/Sources/Optimizer/ModulePasses/MandatoryPerformanceOptimizations.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private func optimizeFunctionsTopDown(using worklist: inout FunctionWorklist,
5050
return
5151
}
5252

53-
optimize(function: f, context, &worklist, isEmbeddedSwift: moduleContext.options.enableEmbeddedSwift)
53+
optimize(function: f, context, &worklist)
5454
}
5555
}
5656
}
@@ -60,7 +60,7 @@ fileprivate struct PathFunctionTuple: Hashable {
6060
var function: Function
6161
}
6262

63-
private func optimize(function: Function, _ context: FunctionPassContext, _ worklist: inout FunctionWorklist, isEmbeddedSwift: Bool) {
63+
private func optimize(function: Function, _ context: FunctionPassContext, _ worklist: inout FunctionWorklist) {
6464
var alreadyInlinedFunctions: Set<PathFunctionTuple> = Set()
6565

6666
var changed = true
@@ -78,15 +78,15 @@ private func optimize(function: Function, _ context: FunctionPassContext, _ work
7878

7979
// Embedded Swift specific transformations
8080
case let alloc as AllocRefInst:
81-
if isEmbeddedSwift {
81+
if context.options.enableEmbeddedSwift {
8282
specializeVTableAndAddEntriesToWorklist(for: alloc.type, in: function, context, &worklist)
8383
}
8484
case let metatype as MetatypeInst:
85-
if isEmbeddedSwift {
85+
if context.options.enableEmbeddedSwift {
8686
specializeVTableAndAddEntriesToWorklist(for: metatype.type, in: function, context, &worklist)
8787
}
8888
case let classMethod as ClassMethodInst:
89-
if isEmbeddedSwift {
89+
if context.options.enableEmbeddedSwift {
9090
_ = context.specializeClassMethodInst(classMethod)
9191
}
9292

0 commit comments

Comments
 (0)