From e10154088bc52d1b25c100576cbb6c925f83b113 Mon Sep 17 00:00:00 2001 From: Ben Cohen Date: Thu, 25 Oct 2018 08:45:48 -0700 Subject: [PATCH 1/2] Uninline float description --- stdlib/public/core/FloatingPointTypes.swift.gyb | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/stdlib/public/core/FloatingPointTypes.swift.gyb b/stdlib/public/core/FloatingPointTypes.swift.gyb index 4afd5ed70a8ff..283ad12d48719 100644 --- a/stdlib/public/core/FloatingPointTypes.swift.gyb +++ b/stdlib/public/core/FloatingPointTypes.swift.gyb @@ -79,16 +79,11 @@ public struct ${Self} { extension ${Self} : CustomStringConvertible { /// A textual representation of the value. - @inlinable public var description: String { - if isFinite { - return _float${bits}ToString(self, debug: false) - } else if isNaN { + if isNaN { return "nan" - } else if sign == .minus { - return "-inf" } else { - return "inf" + return _float${bits}ToString(self, debug: false) } } } @@ -96,13 +91,7 @@ extension ${Self} : CustomStringConvertible { extension ${Self} : CustomDebugStringConvertible { /// A textual representation of the value, suitable for debugging. public var debugDescription: String { - if isFinite || isNaN { - return _float${bits}ToString(self, debug: true) - } else if sign == .minus { - return "-inf" - } else { - return "inf" - } + return _float${bits}ToString(self, debug: true) } } From 92f8f80aeb42e20b70538f136d5fb825199e8550 Mon Sep 17 00:00:00 2001 From: Ben Cohen Date: Thu, 25 Oct 2018 09:05:04 -0700 Subject: [PATCH 2/2] Uninline _floatNNToString --- stdlib/public/core/Runtime.swift.gyb | 2 -- .../Outputs/stability-stdlib-abi.swift.expected | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/public/core/Runtime.swift.gyb b/stdlib/public/core/Runtime.swift.gyb index 0092497aae0b6..79c220b4ea9d2 100644 --- a/stdlib/public/core/Runtime.swift.gyb +++ b/stdlib/public/core/Runtime.swift.gyb @@ -374,7 +374,6 @@ internal struct _Buffer72 { #if !os(Windows) && (arch(i386) || arch(x86_64)) % end -@usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_float${bits}ToString") internal func _float${bits}ToStringImpl( _ buffer: UnsafeMutablePointer, @@ -382,7 +381,6 @@ internal func _float${bits}ToStringImpl( _ debug: Bool ) -> UInt -@inlinable // FIXME(sil-serialize-all) internal func _float${bits}ToString( _ value: Float${bits}, debug: Bool ) -> String { diff --git a/test/api-digester/Outputs/stability-stdlib-abi.swift.expected b/test/api-digester/Outputs/stability-stdlib-abi.swift.expected index a05932aa31323..7a1bc0d8815eb 100644 --- a/test/api-digester/Outputs/stability-stdlib-abi.swift.expected +++ b/test/api-digester/Outputs/stability-stdlib-abi.swift.expected @@ -14,6 +14,12 @@ Constructor _DropFirstSequence.init(_iterator:limit:dropped:) has been removed Constructor _PrefixSequence.init(_iterator:maxLength:taken:) has been removed Func _DropFirstSequence.next() has been removed Func _PrefixSequence.next() has been removed +Func _float32ToString(_:debug:) has been removed +Func _float32ToStringImpl(_:_:_:_:) has been removed +Func _float64ToString(_:debug:) has been removed +Func _float64ToStringImpl(_:_:_:_:) has been removed +Func _float80ToString(_:debug:) has been removed +Func _float80ToStringImpl(_:_:_:_:) has been removed Var _DropFirstSequence._dropped has been removed Var _DropFirstSequence._iterator has been removed Var _PrefixSequence._iterator has been removed