Skip to content

Commit f20f3b5

Browse files
milsemanairspeedswift
authored andcommitted
---
yaml --- r: 260095 b: refs/heads/swift-5.0-branch c: 83ed42a h: refs/heads/master i: 260093: 86487e3 260091: 6ecd7d4 260087: 973ad33 260079: 8e42594 260063: e06d57f 260031: 1bde991 259967: 223dfc1 259839: ebe98c4 259583: ac1ea05 259071: 10b96b9 258047: 9e0348f
1 parent 3872e55 commit f20f3b5

File tree

8 files changed

+38
-15
lines changed

8 files changed

+38
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2017-12-22-a: 5a2d73c274f7917cce75d57bdd7b7
642642
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b7c074342459a645779f106c42bf4852345ed413
643643
refs/heads/master-llvm-swift5-transition: 8ace18c8953afb3d7d94cf04cacc0b51a7e5f1e3
644644
refs/heads/revert-13597-master: cccee1df039d072215f9bddc2cbc1e32a8d5d5ee
645-
refs/heads/swift-5.0-branch: 953d5e8dcf9f26a25374067f46fe80e6178b6ebd
645+
refs/heads/swift-5.0-branch: 83ed42a6023e7840a5a72766cbbfb2aa50754ae5
646646
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-23-a: b32214f7e04339dfada623b6b76dbebfb41e4541
647647
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-24-a: 1eb0be506c0744c7eff0550a10240286046e181d
648648
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-25-a: f35a91502bad0065c83d8760407c23be7b899f48

branches/swift-5.0-branch/stdlib/public/core/StringGutsSlice.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616

1717
// A sliced _StringGuts, convenient for unifying String/Substring comparison,
1818
// hashing, and RRC.
19-
@_fixed_layout
20-
@usableFromInline
2119
internal struct _StringGutsSlice {
22-
@usableFromInline
2320
internal var _guts: _StringGuts
2421

25-
@usableFromInline
2622
internal var _offsetRange: Range<Int>
2723

28-
@inlinable @inline(__always)
24+
@inline(__always)
2925
internal init(_ guts: _StringGuts) {
3026
self._guts = guts
3127
self._offsetRange = 0..<self._guts.count
3228
}
3329

34-
@inlinable @inline(__always)
30+
@inline(__always)
3531
internal init(_ guts: _StringGuts, _ offsetRange: Range<Int>) {
3632
self._guts = guts
3733
self._offsetRange = offsetRange
@@ -83,7 +79,7 @@ internal struct _StringGutsSlice {
8379
}
8480
}
8581

86-
@inlinable @inline(__always)
82+
@inline(__always)
8783
internal func withFastUTF8<R>(
8884
_ f: (UnsafeBufferPointer<UInt8>) throws -> R
8985
) rethrows -> R {

branches/swift-5.0-branch/stdlib/public/core/StringHashable.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ extension StringProtocol {
4545
}
4646

4747
extension _StringGutsSlice {
48-
@usableFromInline // @opaque
4948
@inline(never) // slow-path
5049
internal func _normalizedHash(into hasher: inout Hasher) {
5150
if self.isNFCFastUTF8 {

branches/swift-5.0-branch/stdlib/public/core/StringProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ extension StringProtocol {
132132
get { return String(self) }
133133
}
134134

135-
@inlinable // Eliminate for String, Substring
136135
internal var _gutsSlice: _StringGutsSlice {
137136
@_specialize(where Self == String)
138137
@_specialize(where Self == Substring)
@@ -152,7 +151,8 @@ extension StringProtocol {
152151
@inline(__always) get {
153152
let start = startIndex
154153
let end = endIndex
155-
_internalInvariant(start.transcodedOffset == 0 && end.transcodedOffset == 0)
154+
_internalInvariant(
155+
start.transcodedOffset == 0 && end.transcodedOffset == 0)
156156
return Range(uncheckedBounds: (start.encodedOffset, end.encodedOffset))
157157
}
158158
}

branches/swift-5.0-branch/stdlib/public/core/StringStorage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ final internal class _StringStorage: _AbstractStringStorage {
189189

190190
internal var _reserved: UInt16
191191

192-
@inlinable
193192
override internal var count: Int {
194193
@inline(__always) get { return _count }
195194
@inline(__always) set { _count = newValue }

branches/swift-5.0-branch/stdlib/public/core/StringUTF16View.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ extension String {
537537
) {
538538
_internalInvariant(_guts.isFastUTF8)
539539

540+
if _slowPath(range.isEmpty) { return }
541+
540542
return _guts.withFastUTF8 { utf8 in
541543
var writeIdx = 0
542544
let writeEnd = buffer.count

branches/swift-5.0-branch/test/api-digester/Outputs/stability-stdlib-abi.swift.expected

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,23 @@ Protocol _NSEnumerator has been removed
483483
Protocol _NSFastEnumeration has been removed
484484
Protocol _ShadowProtocol has been removed
485485

486+
Constructor _StringGutsSlice.init(_:) has been removed
487+
Constructor _StringGutsSlice.init(_:_:) has been removed
488+
Func _StringGutsSlice._normalizedHash(into:) has been removed
489+
Func _StringGutsSlice.compare(with:expecting:) has been removed
490+
Func _StringGutsSlice.withFastUTF8(_:) has been removed
491+
Struct _StringGutsSlice is now without @_fixed_layout
492+
Var StringProtocol._gutsSlice has been removed
493+
Var _StringGutsSlice._guts has been removed
494+
Var _StringGutsSlice._offsetRange has been removed
495+
Var _StringGutsSlice.count has been removed
496+
Var _StringGutsSlice.end has been removed
497+
Var _StringGutsSlice.isASCII has been removed
498+
Var _StringGutsSlice.isFastUTF8 has been removed
499+
Var _StringGutsSlice.isNFCFastUTF8 has been removed
500+
Var _StringGutsSlice.range has been removed
501+
Var _StringGutsSlice.start has been removed
502+
486503
Func ManagedBufferPointer._sanityCheckValidBufferClass(_:creating:) has been removed
487504
Func _sanityCheck(_:_:file:line:) has been removed
488505
Func _sanityCheckFailure(_:file:line:) has been removed

branches/swift-5.0-branch/validation-test/stdlib/StringBreadcrumbs.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ let StringBreadcrumbsTests = TestSuite("StringBreadcrumbsTests")
3838

3939
func validateBreadcrumbs(_ str: String) {
4040
var utf16CodeUnits = Array(str.utf16)
41-
var utf16Indices = Array(str.utf16.indices)
4241
var outputBuffer = Array<UInt16>(repeating: 0, count: utf16CodeUnits.count)
4342

44-
for i in 0..<(utf16CodeUnits.count-1) {
45-
for j in (i+1)..<utf16CodeUnits.count {
43+
// Include the endIndex, so we can test end conversions
44+
var utf16Indices = Array(str.utf16.indices) + [str.utf16.endIndex]
45+
46+
for i in 0...utf16CodeUnits.count {
47+
for j in i...utf16CodeUnits.count {
4648
let range = Range(uncheckedBounds: (i, j))
4749

4850
let indexRange = str._toUTF16Indices(range)
51+
4952
// Range<String.Index> <=> Range<Int>
5053
expectEqual(utf16Indices[i], indexRange.lowerBound)
5154
expectEqual(utf16Indices[j], indexRange.upperBound)
@@ -69,6 +72,13 @@ func validateBreadcrumbs(_ str: String) {
6972
}
7073
}
7174

75+
StringBreadcrumbsTests.test("uniform strings") {
76+
validateBreadcrumbs(smallASCII)
77+
validateBreadcrumbs(largeASCII)
78+
validateBreadcrumbs(smallUnicode)
79+
validateBreadcrumbs(largeUnicode)
80+
}
81+
7282
StringBreadcrumbsTests.test("largeString") {
7383
validateBreadcrumbs(largeString)
7484
}

0 commit comments

Comments
 (0)