@@ -60,6 +60,10 @@ extension Context {
6060 _bridged. lookupFunction ( $0) . function
6161 }
6262 }
63+
64+ func notifyNewFunction( function: Function , derivedFrom: Function ) {
65+ _bridged. addFunctionToPassManagerWorklist ( function. bridged, derivedFrom. bridged)
66+ }
6367}
6468
6569/// A context which allows mutation of a function's SIL.
@@ -357,7 +361,7 @@ struct FunctionPassContext : MutatingContext {
357361 return String ( taking: _bridged. mangleOutlinedVariable ( function. bridged) )
358362 }
359363
360- func mangle( withClosureArgs closureArgs: [ Value ] , closureArgIndices: [ Int ] , from applySiteCallee: Function ) -> String {
364+ func mangle( withClosureArguments closureArgs: [ Value ] , closureArgIndices: [ Int ] , from applySiteCallee: Function ) -> String {
361365 closureArgs. withBridgedValues { bridgedClosureArgsRef in
362366 closureArgIndices. withBridgedArrayRef { bridgedClosureArgIndicesRef in
363367 String ( taking: _bridged. mangleWithClosureArgs (
@@ -392,13 +396,13 @@ struct FunctionPassContext : MutatingContext {
392396 }
393397 }
394398
395- func buildSpecializedFunction( specializedFunction: Function , buildFn: ( Function , FunctionPassContext ) -> ( ) ) {
399+ func buildSpecializedFunction< T > ( specializedFunction: Function , buildFn: ( Function , FunctionPassContext ) -> T ) -> T {
396400 let nestedFunctionPassContext =
397401 FunctionPassContext ( _bridged: _bridged. initializeNestedPassContext ( specializedFunction. bridged) )
398402
399403 defer { _bridged. deinitializedNestedPassContext ( ) }
400404
401- buildFn ( specializedFunction, nestedFunctionPassContext)
405+ return buildFn ( specializedFunction, nestedFunctionPassContext)
402406 }
403407}
404408
0 commit comments