@@ -144,7 +144,7 @@ public func registerOptimizerTests() {
144144
145145private func registerFunctionTest( _ test: FunctionTest ) {
146146 test. name. _withBridgedStringRef { ref in
147- registerFunctionTest ( ref, eraseInvocation ( test. invocation) )
147+ registerFunctionTest ( ref, castToOpaquePointer ( fromInvocation : test. invocation) )
148148 }
149149}
150150
@@ -161,7 +161,7 @@ private func functionTestThunk(
161161 _ function: BridgedFunction ,
162162 _ arguments: BridgedTestArguments ,
163163 _ passInvocation: BridgedSwiftPassInvocation ) {
164- let invocation = uneraseInvocation ( erasedInvocation)
164+ let invocation = castToInvocation ( fromOpaquePointer : erasedInvocation)
165165 let context = FunctionPassContext ( _bridged: BridgedPassContext ( invocation: passInvocation. invocation) )
166166 invocation ( function. function, arguments. native, context)
167167}
@@ -170,15 +170,15 @@ private func functionTestThunk(
170170///
171171/// Needed so that the closure can be represented in C++ for storage in the test
172172/// registry.
173- private func eraseInvocation ( _ invocation: FunctionTestInvocation ) -> UnsafeMutableRawPointer {
173+ private func castToOpaquePointer ( fromInvocation invocation: FunctionTestInvocation ) -> UnsafeMutableRawPointer {
174174 return unsafeBitCast ( invocation, to: UnsafeMutableRawPointer . self)
175175}
176176
177177/// Bitcast a void * to a thin test closure.
178178///
179179/// Needed so that the closure stored in the C++ test registry can be invoked
180180/// via the functionTestThunk.
181- private func uneraseInvocation ( _ erasedInvocation: UnsafeMutableRawPointer ) -> FunctionTestInvocation {
181+ private func castToInvocation ( fromOpaquePointer erasedInvocation: UnsafeMutableRawPointer ) -> FunctionTestInvocation {
182182 return unsafeBitCast ( erasedInvocation, to: FunctionTestInvocation . self)
183183}
184184
0 commit comments