Skip to content

Commit

Permalink
Merge pull request #78288 from hamishknight/use-typename
Browse files Browse the repository at this point in the history
[SwiftCompilerSources] Use interpolation instead of `String(describing:)`
  • Loading branch information
hamishknight authored Dec 19, 2024
2 parents ae88aac + f728466 commit 95ae8d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/AST/Registration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public func registerAST() {
}

private func registerDecl<T: AnyObject>(_ cl: T.Type) {
String(describing: cl)._withBridgedStringRef { nameStr in
"\(cl)"._withBridgedStringRef { nameStr in
let metatype = unsafeBitCast(cl, to: SwiftMetatype.self)
registerBridgedDecl(nameStr, metatype)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private func run<InstType: SILCombineSimplifyable>(_ instType: InstType.Type,
private func registerForSILCombine<InstType: SILCombineSimplifyable>(
_ instType: InstType.Type,
_ runFn: @escaping (@convention(c) (BridgedInstructionPassCtxt) -> ())) {
String(describing: instType)._withBridgedStringRef { instClassStr in
"\(instType)"._withBridgedStringRef { instClassStr in
SILCombine_registerInstructionPass(instClassStr, runFn)
}
}
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/Registration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Basic
import SILBridging

private func register<T: AnyObject>(_ cl: T.Type) {
String(describing: cl)._withBridgedStringRef { nameStr in
"\(cl)"._withBridgedStringRef { nameStr in
let metatype = unsafeBitCast(cl, to: SwiftMetatype.self)
registerBridgedClass(nameStr, metatype)
}
Expand Down

0 comments on commit 95ae8d1

Please sign in to comment.