Skip to content

Commit 0270d0f

Browse files
Merge pull request #69069 from nate-chandler/nfc/20231009/1
[SwiftCompilerSources] NFC: Renamed two helper fns
2 parents 4430799 + 99576dc commit 0270d0f

File tree

1 file changed

+4
-4
lines changed
  • SwiftCompilerSources/Sources/Optimizer/Utilities

1 file changed

+4
-4
lines changed

SwiftCompilerSources/Sources/Optimizer/Utilities/Test.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public func registerOptimizerTests() {
144144

145145
private 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

Comments
 (0)