@@ -144,7 +144,7 @@ public func registerOptimizerTests() {
144
144
145
145
private func registerFunctionTest( _ test: FunctionTest ) {
146
146
test. name. _withBridgedStringRef { ref in
147
- registerFunctionTest ( ref, eraseInvocation ( test. invocation) )
147
+ registerFunctionTest ( ref, castToOpaquePointer ( fromInvocation : test. invocation) )
148
148
}
149
149
}
150
150
@@ -161,7 +161,7 @@ private func functionTestThunk(
161
161
_ function: BridgedFunction ,
162
162
_ arguments: BridgedTestArguments ,
163
163
_ passInvocation: BridgedSwiftPassInvocation ) {
164
- let invocation = uneraseInvocation ( erasedInvocation)
164
+ let invocation = castToInvocation ( fromOpaquePointer : erasedInvocation)
165
165
let context = FunctionPassContext ( _bridged: BridgedPassContext ( invocation: passInvocation. invocation) )
166
166
invocation ( function. function, arguments. native, context)
167
167
}
@@ -170,15 +170,15 @@ private func functionTestThunk(
170
170
///
171
171
/// Needed so that the closure can be represented in C++ for storage in the test
172
172
/// registry.
173
- private func eraseInvocation ( _ invocation: FunctionTestInvocation ) -> UnsafeMutableRawPointer {
173
+ private func castToOpaquePointer ( fromInvocation invocation: FunctionTestInvocation ) -> UnsafeMutableRawPointer {
174
174
return unsafeBitCast ( invocation, to: UnsafeMutableRawPointer . self)
175
175
}
176
176
177
177
/// Bitcast a void * to a thin test closure.
178
178
///
179
179
/// Needed so that the closure stored in the C++ test registry can be invoked
180
180
/// via the functionTestThunk.
181
- private func uneraseInvocation ( _ erasedInvocation: UnsafeMutableRawPointer ) -> FunctionTestInvocation {
181
+ private func castToInvocation ( fromOpaquePointer erasedInvocation: UnsafeMutableRawPointer ) -> FunctionTestInvocation {
182
182
return unsafeBitCast ( erasedInvocation, to: FunctionTestInvocation . self)
183
183
}
184
184
0 commit comments