Skip to content

Commit 92b6d8c

Browse files
Remove inlineability from mirrors (#17476)
1 parent 7f33f47 commit 92b6d8c

27 files changed

+1
-78
lines changed

stdlib/public/core/AnyHashable.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ extension AnyHashable : CustomStringConvertible {
305305
}
306306

307307
extension AnyHashable : CustomDebugStringConvertible {
308-
@inlinable // FIXME(sil-serialize-all)
309308
public var debugDescription: String {
310309
return "AnyHashable(" + String(reflecting: base) + ")"
311310
}

stdlib/public/core/CTypes.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ extension OpaquePointer: Hashable {
187187

188188
extension OpaquePointer : CustomDebugStringConvertible {
189189
/// A textual representation of the pointer, suitable for debugging.
190-
@inlinable // FIXME(sil-serialize-all)
191190
public var debugDescription: String {
192191
return _rawPointerToString(_rawValue)
193192
}
@@ -236,7 +235,6 @@ public struct CVaListPointer {
236235

237236
extension CVaListPointer : CustomDebugStringConvertible {
238237
/// A textual representation of the pointer, suitable for debugging.
239-
@inlinable // FIXME(sil-serialize-all)
240238
public var debugDescription: String {
241239
return value.debugDescription
242240
}

stdlib/public/core/Character.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ extension Character : LosslessStringConvertible { }
367367

368368
extension Character : CustomDebugStringConvertible {
369369
/// A textual representation of the character, suitable for debugging.
370-
@inlinable // FIXME(sil-serialize-all)
371370
public var debugDescription: String {
372371
return String(self).debugDescription
373372
}

stdlib/public/core/ClosedRange.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,13 @@ extension ClosedRange : CustomStringConvertible {
412412

413413
extension ClosedRange : CustomDebugStringConvertible {
414414
/// A textual representation of the range, suitable for debugging.
415-
@inlinable // FIXME(sil-serialize-all)
416415
public var debugDescription: String {
417416
return "ClosedRange(\(String(reflecting: lowerBound))"
418417
+ "...\(String(reflecting: upperBound)))"
419418
}
420419
}
421420

422421
extension ClosedRange : CustomReflectable {
423-
@inlinable // FIXME(sil-serialize-all)
424422
public var customMirror: Mirror {
425423
return Mirror(
426424
self, children: ["lowerBound": lowerBound, "upperBound": upperBound])

stdlib/public/core/Codable.swift.gyb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ extension CodingKey {
9292
}
9393

9494
/// A textual representation of this key, suitable for debugging.
95-
@inlinable // FIXME(sil-serialize-all)
9695
public var debugDescription: String {
9796
return description
9897
}

stdlib/public/core/CollectionOfOne.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,12 @@ extension CollectionOfOne: RandomAccessCollection, MutableCollection {
160160

161161
extension CollectionOfOne : CustomDebugStringConvertible {
162162
/// A textual representation of the collection, suitable for debugging.
163-
@inlinable // FIXME(sil-serialize-all)
164163
public var debugDescription: String {
165164
return "CollectionOfOne(\(String(reflecting: _element)))"
166165
}
167166
}
168167

169168
extension CollectionOfOne : CustomReflectable {
170-
@inlinable // FIXME(sil-serialize-all)
171169
public var customMirror: Mirror {
172170
return Mirror(self, children: ["element": _element])
173171
}

stdlib/public/core/Dictionary.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,6 @@ extension Dictionary {
13481348
return _makeCollectionDescription(for: self, withTypeName: nil)
13491349
}
13501350

1351-
@inlinable // FIXME(sil-serialize-all)
13521351
public var debugDescription: String {
13531352
return _makeCollectionDescription(for: self, withTypeName: "Dictionary.Keys")
13541353
}
@@ -1419,7 +1418,6 @@ extension Dictionary {
14191418
return _makeCollectionDescription(for: self, withTypeName: nil)
14201419
}
14211420

1422-
@inlinable // FIXME(sil-serialize-all)
14231421
public var debugDescription: String {
14241422
return _makeCollectionDescription(for: self, withTypeName: "Dictionary.Values")
14251423
}
@@ -1551,7 +1549,6 @@ extension Dictionary: CustomStringConvertible, CustomDebugStringConvertible {
15511549

15521550
/// A string that represents the contents of the dictionary, suitable for
15531551
/// debugging.
1554-
@inlinable // FIXME(sil-serialize-all)
15551552
public var debugDescription: String {
15561553
return _makeDescription()
15571554
}
@@ -4661,7 +4658,6 @@ public struct DictionaryIterator<Key: Hashable, Value>: IteratorProtocol {
46614658

46624659
extension DictionaryIterator: CustomReflectable {
46634660
/// A mirror that reflects the iterator.
4664-
@inlinable // FIXME(sil-serialize-all)
46654661
public var customMirror: Mirror {
46664662
return Mirror(
46674663
self,
@@ -4671,7 +4667,6 @@ extension DictionaryIterator: CustomReflectable {
46714667

46724668
extension Dictionary: CustomReflectable {
46734669
/// A mirror that reflects the dictionary.
4674-
@inlinable // FIXME(sil-serialize-all)
46754670
public var customMirror: Mirror {
46764671
let style = Mirror.DisplayStyle.dictionary
46774672
return Mirror(self, unlabeledChildren: self, displayStyle: style)

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ extension ${Self} : CustomStringConvertible {
9797

9898
extension ${Self} : CustomDebugStringConvertible {
9999
/// A textual representation of the value, suitable for debugging.
100-
@inlinable // FIXME(sil-serialize-all)
101100
public var debugDescription: String {
102101
if isFinite || isNaN {
103102
return _float${bits}ToString(self, debug: true)

stdlib/public/core/Mirror.swift

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,13 @@
3737
///
3838
/// To customize the mirror representation of a custom type, add conformance to
3939
/// the `CustomReflectable` protocol.
40-
@_fixed_layout // FIXME(sil-serialize-all)
4140
public struct Mirror {
4241
/// Representation of descendant classes that don't override
4342
/// `customMirror`.
4443
///
4544
/// Note that the effect of this setting goes no deeper than the
4645
/// nearest descendant class that overrides `customMirror`, which
4746
/// in turn can determine representation of *its* descendants.
48-
@_frozen // FIXME(sil-serialize-all)
49-
@usableFromInline // FIXME(sil-serialize-all)
5047
internal enum _DefaultDescendantRepresentation {
5148
/// Generate a default mirror for descendant classes that don't
5249
/// override `customMirror`.
@@ -115,7 +112,6 @@ public struct Mirror {
115112
/// though, the observability of mutations is unspecified.
116113
///
117114
/// - Parameter subject: The instance for which to create a mirror.
118-
@inlinable // FIXME(sil-serialize-all)
119115
public init(reflecting subject: Any) {
120116
if case let customized as CustomReflectable = subject {
121117
self = customized.customMirror
@@ -156,12 +152,10 @@ public struct Mirror {
156152
case dictionary, `set`
157153
}
158154

159-
@inlinable // FIXME(sil-serialize-all)
160155
internal static func _noSuperclassMirror() -> Mirror? { return nil }
161156

162157
@_semantics("optimize.sil.specialize.generic.never")
163158
@inline(never)
164-
@usableFromInline
165159
internal static func _superclassIterator<Subject>(
166160
_ subject: Subject, _ ancestorRepresentation: AncestorRepresentation
167161
) -> () -> Mirror? {
@@ -218,7 +212,6 @@ public struct Mirror {
218212
/// - ancestorRepresentation: The means of generating the subject's
219213
/// ancestor representation. `ancestorRepresentation` is ignored if
220214
/// `subject` is not a class instance. The default is `.generated`.
221-
@inlinable // FIXME(sil-serialize-all)
222215
public init<Subject, C : Collection>(
223216
_ subject: Subject,
224217
children: C,
@@ -264,7 +257,6 @@ public struct Mirror {
264257
/// - ancestorRepresentation: The means of generating the subject's
265258
/// ancestor representation. `ancestorRepresentation` is ignored if
266259
/// `subject` is not a class instance. The default is `.generated`.
267-
@inlinable // FIXME(sil-serialize-all)
268260
public init<Subject, C : Collection>(
269261
_ subject: Subject,
270262
unlabeledChildren: C,
@@ -315,7 +307,6 @@ public struct Mirror {
315307
/// - ancestorRepresentation: The means of generating the subject's
316308
/// ancestor representation. `ancestorRepresentation` is ignored if
317309
/// `subject` is not a class instance. The default is `.generated`.
318-
@inlinable // FIXME(sil-serialize-all)
319310
public init<Subject>(
320311
_ subject: Subject,
321312
children: DictionaryLiteral<String, Any>,
@@ -348,14 +339,11 @@ public struct Mirror {
348339
public let displayStyle: DisplayStyle?
349340

350341
/// A mirror of the subject's superclass, if one exists.
351-
@inlinable // FIXME(sil-serialize-all)
352342
public var superclassMirror: Mirror? {
353343
return _makeSuperclassMirror()
354344
}
355345

356-
@usableFromInline // FIXME(sil-serialize-all)
357346
internal let _makeSuperclassMirror: () -> Mirror?
358-
@usableFromInline // FIXME(sil-serialize-all)
359347
internal let _defaultDescendantRepresentation: _DefaultDescendantRepresentation
360348
}
361349

@@ -393,16 +381,11 @@ extension Int : MirrorPath {}
393381
extension String : MirrorPath {}
394382

395383
extension Mirror {
396-
@_fixed_layout // FIXME(sil-serialize-all)
397-
@usableFromInline // FIXME(sil-serialize-all)
398384
internal struct _Dummy : CustomReflectable {
399-
@inlinable // FIXME(sil-serialize-all)
400-
internal init(mirror: Mirror) {
385+
internal init(mirror: Mirror) {
401386
self.mirror = mirror
402387
}
403-
@usableFromInline // FIXME(sil-serialize-all)
404388
internal var mirror: Mirror
405-
@inlinable // FIXME(sil-serialize-all)
406389
internal var customMirror: Mirror { return mirror }
407390
}
408391

@@ -450,7 +433,6 @@ extension Mirror {
450433
/// - rest: Any remaining mirror path components.
451434
/// - Returns: The descendant of this mirror specified by the given mirror
452435
/// path components if such a descendant exists; otherwise, `nil`.
453-
@inlinable // FIXME(sil-serialize-all)
454436
public func descendant(
455437
_ first: MirrorPath, _ rest: MirrorPath...
456438
) -> Any? {
@@ -584,7 +566,6 @@ extension PlaygroundQuickLook {
584566
///
585567
/// - Parameter subject: The instance to represent with the resulting Quick
586568
/// Look.
587-
@inlinable // FIXME(sil-serialize-all)
588569
@available(*, deprecated, message: "PlaygroundQuickLook will be removed in a future Swift version.")
589570
public init(reflecting subject: Any) {
590571
if let customized = subject as? CustomPlaygroundQuickLookable {
@@ -712,7 +693,6 @@ public struct DictionaryLiteral<Key, Value> : ExpressibleByDictionaryLiteral {
712693
///
713694
/// The order of the key-value pairs is kept intact in the resulting
714695
/// `DictionaryLiteral` instance.
715-
@inlinable // FIXME(sil-serialize-all)
716696
public init(dictionaryLiteral elements: (Key, Value)...) {
717697
self._elements = elements
718698
}
@@ -856,14 +836,12 @@ extension String {
856836

857837
/// Reflection for `Mirror` itself.
858838
extension Mirror : CustomStringConvertible {
859-
@inlinable // FIXME(sil-serialize-all)
860839
public var description: String {
861840
return "Mirror for \(self.subjectType)"
862841
}
863842
}
864843

865844
extension Mirror : CustomReflectable {
866-
@inlinable // FIXME(sil-serialize-all)
867845
public var customMirror: Mirror {
868846
return Mirror(self, children: [:])
869847
}

stdlib/public/core/Mirrors.swift.gyb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ for self_ty in all_integer_types(word_bits):
3939

4040
extension ${Type[0]} : CustomReflectable {
4141
/// A mirror that reflects the `${Type[0]}` instance.
42-
@inlinable // FIXME(sil-serialize-all)
4342
public var customMirror: Mirror {
4443
return Mirror(self, unlabeledChildren: EmptyCollection<Void>())
4544
}

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public struct ObjectIdentifier {
6363

6464
extension ObjectIdentifier : CustomDebugStringConvertible {
6565
/// A textual representation of the identifier, suitable for debugging.
66-
@inlinable // FIXME(sil-serialize-all)
6766
public var debugDescription: String {
6867
return "ObjectIdentifier(\(_rawPointerToString(_value)))"
6968
}

stdlib/public/core/Optional.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public enum Optional<Wrapped> : ExpressibleByNilLiteral {
269269

270270
extension Optional : CustomDebugStringConvertible {
271271
/// A textual representation of this instance, suitable for debugging.
272-
@inlinable // FIXME(sil-serialize-all)
273272
public var debugDescription: String {
274273
switch self {
275274
case .some(let value):
@@ -284,7 +283,6 @@ extension Optional : CustomDebugStringConvertible {
284283
}
285284

286285
extension Optional : CustomReflectable {
287-
@inlinable // FIXME(sil-serialize-all)
288286
public var customMirror: Mirror {
289287
switch self {
290288
case .some(let value):

stdlib/public/core/Range.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,13 @@ extension Range : CustomStringConvertible {
363363

364364
extension Range : CustomDebugStringConvertible {
365365
/// A textual representation of the range, suitable for debugging.
366-
@inlinable // FIXME(sil-serialize-all)
367366
public var debugDescription: String {
368367
return "Range(\(String(reflecting: lowerBound))"
369368
+ "..<\(String(reflecting: upperBound)))"
370369
}
371370
}
372371

373372
extension Range : CustomReflectable {
374-
@inlinable // FIXME(sil-serialize-all)
375373
public var customMirror: Mirror {
376374
return Mirror(
377375
self, children: ["lowerBound": lowerBound, "upperBound": upperBound])

stdlib/public/core/ReflectionMirror.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,14 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@usableFromInline // FIXME(sil-serialize-all)
1413
@_silgen_name("swift_reflectionMirror_normalizedType")
1514
internal func _getNormalizedType<T>(_: T, type: Any.Type) -> Any.Type
1615

17-
@usableFromInline // FIXME(sil-serialize-all)
1816
@_silgen_name("swift_reflectionMirror_count")
1917
internal func _getChildCount<T>(_: T, type: Any.Type) -> Int
2018

21-
@usableFromInline // FIXME(sil-serialize-all)
2219
internal typealias NameFreeFunc = @convention(c) (UnsafePointer<CChar>?) -> Void
2320

24-
@usableFromInline // FIXME(sil-serialize-all)
2521
@_silgen_name("swift_reflectionMirror_subscript")
2622
internal func _getChild<T>(
2723
of: T,
@@ -32,11 +28,9 @@ internal func _getChild<T>(
3228
) -> Any
3329

3430
// Returns 'c' (class), 'e' (enum), 's' (struct), 't' (tuple), or '\0' (none)
35-
@usableFromInline // FIXME(sil-serialize-all)
3631
@_silgen_name("swift_reflectionMirror_displayStyle")
3732
internal func _getDisplayStyle<T>(_: T) -> CChar
3833

39-
@inlinable // FIXME(sil-serialize-all)
4034
internal func getChild<T>(of value: T, type: Any.Type, index: Int) -> (label: String?, value: Any) {
4135
var nameC: UnsafePointer<CChar>? = nil
4236
var freeFunc: NameFreeFunc? = nil
@@ -49,20 +43,16 @@ internal func getChild<T>(of value: T, type: Any.Type, index: Int) -> (label: St
4943
}
5044

5145
#if _runtime(_ObjC)
52-
@usableFromInline // FIXME(sil-serialize-all)
5346
@_silgen_name("swift_reflectionMirror_quickLookObject")
5447
internal func _getQuickLookObject<T>(_: T) -> AnyObject?
5548

56-
@usableFromInline // FIXME(sil-serialize-all)
5749
@_silgen_name("_swift_stdlib_NSObject_isKindOfClass")
5850
internal func _isImpl(_ object: AnyObject, kindOf: AnyObject) -> Bool
5951

60-
@inlinable // FIXME(sil-serialize-all)
6152
internal func _is(_ object: AnyObject, kindOf `class`: String) -> Bool {
6253
return _isImpl(object, kindOf: `class` as AnyObject)
6354
}
6455

65-
@inlinable // FIXME(sil-serialize-all)
6656
internal func _getClassPlaygroundQuickLook(
6757
_ object: AnyObject
6858
) -> PlaygroundQuickLook? {
@@ -112,7 +102,6 @@ internal func _getClassPlaygroundQuickLook(
112102
#endif
113103

114104
extension Mirror {
115-
@inlinable // FIXME(sil-serialize-all)
116105
internal init(internalReflecting subject: Any,
117106
subjectType: Any.Type? = nil,
118107
customAncestor: Mirror? = nil)
@@ -160,7 +149,6 @@ extension Mirror {
160149
self._defaultDescendantRepresentation = .generated
161150
}
162151

163-
@inlinable // FIXME(sil-serialize-all)
164152
internal static func quickLookObject(_ subject: Any) -> PlaygroundQuickLook? {
165153
#if _runtime(_ObjC)
166154
let object = _getQuickLookObject(subject)

stdlib/public/core/Set.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,6 @@ extension Set: CustomStringConvertible, CustomDebugStringConvertible {
10381038
}
10391039

10401040
/// A string that represents the contents of the set, suitable for debugging.
1041-
@inlinable // FIXME(sil-serialize-all)
10421041
public var debugDescription: String {
10431042
return _makeCollectionDescription(for: self, withTypeName: "Set")
10441043
}
@@ -3928,7 +3927,6 @@ public struct SetIterator<Element: Hashable>: IteratorProtocol {
39283927

39293928
extension SetIterator: CustomReflectable {
39303929
/// A mirror that reflects the iterator.
3931-
@inlinable // FIXME(sil-serialize-all)
39323930
public var customMirror: Mirror {
39333931
return Mirror(
39343932
self,
@@ -3938,7 +3936,6 @@ extension SetIterator: CustomReflectable {
39383936

39393937
extension Set: CustomReflectable {
39403938
/// A mirror that reflects the set.
3941-
@inlinable // FIXME(sil-serialize-all)
39423939
public var customMirror: Mirror {
39433940
let style = Mirror.DisplayStyle.`set`
39443941
return Mirror(self, unlabeledChildren: self, displayStyle: style)

0 commit comments

Comments
 (0)