Skip to content

Commit 116dac1

Browse files
[stdlib] Uninline float description (#20038)
* Uninline float description * Uninline _floatNNToString
1 parent 3082bbf commit 116dac1

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,19 @@ public struct ${Self} {
7979
8080
extension ${Self} : CustomStringConvertible {
8181
/// A textual representation of the value.
82-
@inlinable
8382
public var description: String {
84-
if isFinite {
85-
return _float${bits}ToString(self, debug: false)
86-
} else if isNaN {
83+
if isNaN {
8784
return "nan"
88-
} else if sign == .minus {
89-
return "-inf"
9085
} else {
91-
return "inf"
86+
return _float${bits}ToString(self, debug: false)
9287
}
9388
}
9489
}
9590
9691
extension ${Self} : CustomDebugStringConvertible {
9792
/// A textual representation of the value, suitable for debugging.
9893
public var debugDescription: String {
99-
if isFinite || isNaN {
100-
return _float${bits}ToString(self, debug: true)
101-
} else if sign == .minus {
102-
return "-inf"
103-
} else {
104-
return "inf"
105-
}
94+
return _float${bits}ToString(self, debug: true)
10695
}
10796
}
10897

stdlib/public/core/Runtime.swift.gyb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,13 @@ internal struct _Buffer72 {
374374
#if !os(Windows) && (arch(i386) || arch(x86_64))
375375
% end
376376

377-
@usableFromInline // FIXME(sil-serialize-all)
378377
@_silgen_name("swift_float${bits}ToString")
379378
internal func _float${bits}ToStringImpl(
380379
_ buffer: UnsafeMutablePointer<UTF8.CodeUnit>,
381380
_ bufferLength: UInt, _ value: Float${bits},
382381
_ debug: Bool
383382
) -> UInt
384383

385-
@inlinable // FIXME(sil-serialize-all)
386384
internal func _float${bits}ToString(
387385
_ value: Float${bits}, debug: Bool
388386
) -> String {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Constructor _DropFirstSequence.init(_iterator:limit:dropped:) has been removed
1414
Constructor _PrefixSequence.init(_iterator:maxLength:taken:) has been removed
1515
Func _DropFirstSequence.next() has been removed
1616
Func _PrefixSequence.next() has been removed
17+
Func _float32ToString(_:debug:) has been removed
18+
Func _float32ToStringImpl(_:_:_:_:) has been removed
19+
Func _float64ToString(_:debug:) has been removed
20+
Func _float64ToStringImpl(_:_:_:_:) has been removed
21+
Func _float80ToString(_:debug:) has been removed
22+
Func _float80ToStringImpl(_:_:_:_:) has been removed
1723
Var _DropFirstSequence._dropped has been removed
1824
Var _DropFirstSequence._iterator has been removed
1925
Var _PrefixSequence._iterator has been removed

0 commit comments

Comments
 (0)