Skip to content

Commit 57fe58a

Browse files
authored
Merge pull request #59798 from glessard/aeic-mangled-names-5.7
[5.7][stdlib] Improve the mangled names of some @_alwaysEmitIntoClient functions
2 parents 1609122 + 2ea752a commit 57fe58a

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

stdlib/public/core/UnsafeBufferPointer.swift.gyb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,9 @@ extension Unsafe${Mutable}BufferPointer {
730730
@_alwaysEmitIntoClient
731731
// This custom silgen name is chosen to not interfere with the old ABI
732732
% if Mutable:
733-
@_silgen_name("$_swift_se0333_UnsafeMutableBufferPointer_withMemoryRebound")
733+
@_silgen_name("_swift_se0333_UnsafeMutableBufferPointer_withMemoryRebound")
734734
% else:
735-
@_silgen_name("$_swift_se0333_UnsafeBufferPointer_withMemoryRebound")
735+
@_silgen_name("_swift_se0333_UnsafeBufferPointer_withMemoryRebound")
736736
% end
737737
public func withMemoryRebound<T, Result>(
738738
to type: T.Type,
@@ -763,8 +763,9 @@ extension Unsafe${Mutable}BufferPointer {
763763
}
764764

765765
// This unavailable implementation uses the expected mangled name
766-
// of `withMemoryRebound`, and provides an entry point for any
767-
// binary compiled against the stlib binary for Swift 5.6 and older.
766+
// of `withMemoryRebound<T, Result>(to:_:)`, and provides
767+
// an entry point for any binary linked against the stlib binary
768+
// for Swift 5.6 and older.
768769
@available(*, unavailable)
769770
% if Mutable:
770771
@_silgen_name("$sSr17withMemoryRebound2to_qd_0_qd__m_qd_0_Sryqd__GKXEtKr0_lF")

stdlib/public/core/UnsafePointer.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,9 @@ public struct UnsafePointer<Pointee>: _Pointer {
326326
}
327327

328328
// This unavailable implementation uses the expected mangled name
329-
// of `withMemoryRebound`, and provides an entry point for any
330-
// binary compiled against the stlib binary for Swift 5.6 and older.
329+
// of `withMemoryRebound<T, Result>(to:capacity:_:)`, and provides
330+
// an entry point for any binary linked against the stlib binary
331+
// for Swift 5.6 and older.
331332
@available(*, unavailable)
332333
@_silgen_name("$sSP17withMemoryRebound2to8capacity_qd_0_qd__m_Siqd_0_SPyqd__GKXEtKr0_lF")
333334
@usableFromInline
@@ -1013,7 +1014,7 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
10131014
@inlinable
10141015
@_alwaysEmitIntoClient
10151016
// This custom silgen name is chosen to not interfere with the old ABI
1016-
@_silgen_name("$_swift_se0333_UnsafeMutablePointer_withMemoryRebound")
1017+
@_silgen_name("_swift_se0333_UnsafeMutablePointer_withMemoryRebound")
10171018
public func withMemoryRebound<T, Result>(
10181019
to type: T.Type,
10191020
capacity count: Int,
@@ -1032,8 +1033,9 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
10321033
}
10331034

10341035
// This unavailable implementation uses the expected mangled name
1035-
// of `withMemoryRebound`, and provides an entry point for any
1036-
// binary compiled against the stlib binary for Swift 5.6 and older.
1036+
// of `withMemoryRebound<T, Result>(to:capacity:_:)`, and provides
1037+
// an entry point for any binary linked against the stlib binary
1038+
// for Swift 5.6 and older.
10371039
@available(*, unavailable)
10381040
@_silgen_name("$sSp17withMemoryRebound2to8capacity_qd_0_qd__m_Siqd_0_Spyqd__GKXEtKr0_lF")
10391041
@usableFromInline

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ extension Unsafe${Mutable}RawBufferPointer {
463463
/// with `type`.
464464
@inlinable
465465
@_alwaysEmitIntoClient
466+
// This custom silgen name is chosen to not interfere with the old ABI
466467
@_silgen_name("_swift_se0349_UnsafeMutableRawBufferPointer_storeBytes")
467468
public func storeBytes<T>(
468469
of value: T, toByteOffset offset: Int = 0, as type: T.Type
@@ -477,7 +478,7 @@ extension Unsafe${Mutable}RawBufferPointer {
477478

478479
// This unavailable implementation uses the expected mangled name
479480
// of `storeBytes<T>(of:toByteOffset:as:)`, and provides an entry point for
480-
// any binary compiled against the stlib binary for Swift 5.6 and older.
481+
// any binary linked against the stlib binary for Swift 5.6 and older.
481482
@available(*, unavailable)
482483
@_silgen_name("$sSw10storeBytes2of12toByteOffset2asyx_SixmtlF")
483484
@usableFromInline func _legacy_se0349_storeBytes<T>(

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ public struct UnsafeMutableRawPointer: _Pointer {
12261226
/// - type: The type of `value`.
12271227
@inlinable
12281228
@_alwaysEmitIntoClient
1229+
// This custom silgen name is chosen to not interfere with the old ABI
12291230
@_silgen_name("_swift_se0349_UnsafeMutableRawPointer_storeBytes")
12301231
public func storeBytes<T>(
12311232
of value: T, toByteOffset offset: Int = 0, as type: T.Type

0 commit comments

Comments
 (0)