Skip to content

Commit 66e6c00

Browse files
[stdlib] Move unused functions to LegacyABI.swift (#75462)
1 parent 801417b commit 66e6c00

File tree

3 files changed

+28
-30
lines changed

3 files changed

+28
-30
lines changed

stdlib/public/core/IntegerTypes.swift.gyb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -761,26 +761,6 @@ extension Int {
761761
}
762762
}
763763

764-
@_transparent
765-
@inlinable
766-
internal func _unsafePlus(_ lhs: Int, _ rhs: Int) -> Int {
767-
#if INTERNAL_CHECKS_ENABLED
768-
return lhs + rhs
769-
#else
770-
return lhs &+ rhs
771-
#endif
772-
}
773-
774-
@_transparent
775-
@inlinable
776-
internal func _unsafeMinus(_ lhs: Int, _ rhs: Int) -> Int {
777-
#if INTERNAL_CHECKS_ENABLED
778-
return lhs - rhs
779-
#else
780-
return lhs &- rhs
781-
#endif
782-
}
783-
784764
@_unavailableInEmbedded
785765
internal struct _IntegerAnyHashableBox<
786766
Base: FixedWidthInteger

stdlib/public/core/LegacyABI.swift

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -87,3 +87,29 @@ extension String.UTF16View {
8787
@inlinable @inline(__always)
8888
internal var _shortHeuristic: Int { return 32 }
8989
}
90+
91+
@usableFromInline
92+
internal func unimplemented_utf8_32bit(
93+
_ message: String = "",
94+
file: StaticString = #file, line: UInt = #line
95+
) -> Never {
96+
fatalError("32-bit: Unimplemented for UTF-8 support", file: file, line: line)
97+
}
98+
99+
@usableFromInline
100+
internal func _unsafePlus(_ lhs: Int, _ rhs: Int) -> Int {
101+
#if INTERNAL_CHECKS_ENABLED
102+
return lhs + rhs
103+
#else
104+
return lhs &+ rhs
105+
#endif
106+
}
107+
108+
@usableFromInline
109+
internal func _unsafeMinus(_ lhs: Int, _ rhs: Int) -> Int {
110+
#if INTERNAL_CHECKS_ENABLED
111+
return lhs - rhs
112+
#else
113+
return lhs &- rhs
114+
#endif
115+
}

stdlib/public/core/String.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2024 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -12,14 +12,6 @@
1212

1313
import SwiftShims
1414

15-
@inlinable @_transparent
16-
internal func unimplemented_utf8_32bit(
17-
_ message: String = "",
18-
file: StaticString = #file, line: UInt = #line
19-
) -> Never {
20-
fatalError("32-bit: Unimplemented for UTF-8 support", file: file, line: line)
21-
}
22-
2315
/// A Unicode string value that is a collection of characters.
2416
///
2517
/// A string is a series of characters, such as `"Swift"`, that forms a

0 commit comments

Comments
 (0)