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 - 2020 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
99// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010//
1111//===----------------------------------------------------------------------===//
12-
12+ //
1313// This file contains non-API (or underscored) declarations that are needed to
1414// be kept around for ABI compatibility
15+ //
16+ //===----------------------------------------------------------------------===//
1517
1618extension Unicode . UTF16 {
1719 @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 {
2022 return Unicode . UTF16. isASCII ( x)
2123 }
2224}
2325
2426@available ( * , unavailable, renamed: " Unicode.UTF8.isASCII " )
25- @inlinable
27+ @usableFromInline
2628internal func _isASCII( _ x: UInt8 ) -> Bool {
2729 return Unicode . UTF8. isASCII ( x)
2830}
2931
3032@available ( * , unavailable, renamed: " Unicode.UTF8.isContinuation " )
31- @inlinable
33+ @usableFromInline
3234internal func _isContinuation( _ x: UInt8 ) -> Bool {
3335 return UTF8 . isContinuation ( x)
3436}
3537
3638extension Substring {
37- @available ( * , unavailable, renamed: " Substring.base " )
38- @inlinable
39+ @available ( * , unavailable, renamed: " Substring.base " )
40+ @usableFromInline
3941 internal var _wholeString : String { return base }
4042}
4143
4244extension String {
4345 @available ( * , unavailable, renamed: " String.withUTF8 " )
44- @inlinable
46+ @usableFromInline
4547 internal func _withUTF8< R> (
4648 _ body: ( UnsafeBufferPointer < UInt8 > ) throws -> R
4749 ) rethrows -> R {
@@ -52,7 +54,7 @@ extension String {
5254
5355extension Substring {
5456 @available ( * , unavailable, renamed: " Substring.withUTF8 " )
55- @inlinable
57+ @usableFromInline
5658 internal func _withUTF8< R> (
5759 _ body: ( UnsafeBufferPointer < UInt8 > ) throws -> R
5860 ) rethrows -> R {
@@ -63,6 +65,7 @@ extension Substring {
6365
6466// This function is no longer used but must be kept for ABI compatibility
6567// because references to it may have been inlined.
68+ @available ( * , unavailable)
6669@usableFromInline
6770internal func _branchHint( _ actual: Bool , expected: Bool ) -> Bool {
6871 // The LLVM intrinsic underlying int_expect_Int1 now requires an immediate
@@ -73,6 +76,7 @@ internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
7376}
7477
7578extension String {
79+ @available ( * , unavailable)
7680 @usableFromInline // Never actually used in inlinable code...
7781 internal func _nativeCopyUTF16CodeUnits(
7882 into buffer: UnsafeMutableBufferPointer < UInt16 > ,
@@ -84,6 +88,7 @@ extension String.UTF16View {
8488 // Swift 5.x: This was accidentally shipped as inlinable, but was never used
8589 // from an inlinable context. The definition is kept around for techincal ABI
8690 // compatibility (even though it shouldn't matter), but is unused.
87- @inlinable @inline ( __always)
91+ @available ( * , unavailable)
92+ @usableFromInline
8893 internal var _shortHeuristic : Int { return 32 }
8994}
0 commit comments