2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
5
- // Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
5
+ // Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6
6
// Licensed under Apache License v2.0 with Runtime Library Exception
7
7
//
8
8
// See https://swift.org/LICENSE.txt for license information
9
9
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
//
11
11
//===----------------------------------------------------------------------===//
12
-
12
+ //
13
13
// This file contains non-API (or underscored) declarations that are needed to
14
14
// be kept around for ABI compatibility
15
+ //
16
+ //===----------------------------------------------------------------------===//
15
17
16
18
extension Unicode . UTF16 {
17
19
@available ( * , unavailable, renamed: " Unicode.UTF16.isASCII " )
18
- @inlinable
19
- public static func _isASCII( _ x: CodeUnit ) -> Bool {
20
+ @usableFromInline
21
+ internal static func _isASCII( _ x: CodeUnit ) -> Bool {
20
22
return Unicode . UTF16. isASCII ( x)
21
23
}
22
24
}
23
25
24
26
@available ( * , unavailable, renamed: " Unicode.UTF8.isASCII " )
25
- @inlinable
27
+ @usableFromInline
26
28
internal func _isASCII( _ x: UInt8 ) -> Bool {
27
29
return Unicode . UTF8. isASCII ( x)
28
30
}
29
31
30
32
@available ( * , unavailable, renamed: " Unicode.UTF8.isContinuation " )
31
- @inlinable
33
+ @usableFromInline
32
34
internal func _isContinuation( _ x: UInt8 ) -> Bool {
33
35
return UTF8 . isContinuation ( x)
34
36
}
35
37
36
38
extension Substring {
37
- @available ( * , unavailable, renamed: " Substring.base " )
38
- @inlinable
39
+ @available ( * , unavailable, renamed: " Substring.base " )
40
+ @usableFromInline
39
41
internal var _wholeString : String { return base }
40
42
}
41
43
42
44
extension String {
43
45
@available ( * , unavailable, renamed: " String.withUTF8 " )
44
- @inlinable
46
+ @usableFromInline
45
47
internal func _withUTF8< R> (
46
48
_ body: ( UnsafeBufferPointer < UInt8 > ) throws -> R
47
49
) rethrows -> R {
@@ -52,7 +54,7 @@ extension String {
52
54
53
55
extension Substring {
54
56
@available ( * , unavailable, renamed: " Substring.withUTF8 " )
55
- @inlinable
57
+ @usableFromInline
56
58
internal func _withUTF8< R> (
57
59
_ body: ( UnsafeBufferPointer < UInt8 > ) throws -> R
58
60
) rethrows -> R {
@@ -63,6 +65,7 @@ extension Substring {
63
65
64
66
// This function is no longer used but must be kept for ABI compatibility
65
67
// because references to it may have been inlined.
68
+ @available ( * , unavailable)
66
69
@usableFromInline
67
70
internal func _branchHint( _ actual: Bool , expected: Bool ) -> Bool {
68
71
// The LLVM intrinsic underlying int_expect_Int1 now requires an immediate
@@ -73,6 +76,7 @@ internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
73
76
}
74
77
75
78
extension String {
79
+ @available ( * , unavailable)
76
80
@usableFromInline // Never actually used in inlinable code...
77
81
internal func _nativeCopyUTF16CodeUnits(
78
82
into buffer: UnsafeMutableBufferPointer < UInt16 > ,
@@ -84,6 +88,7 @@ extension String.UTF16View {
84
88
// Swift 5.x: This was accidentally shipped as inlinable, but was never used
85
89
// from an inlinable context. The definition is kept around for techincal ABI
86
90
// compatibility (even though it shouldn't matter), but is unused.
87
- @inlinable @inline ( __always)
91
+ @available ( * , unavailable)
92
+ @usableFromInline
88
93
internal var _shortHeuristic : Int { return 32 }
89
94
}
0 commit comments