Skip to content

Commit 397c22b

Browse files
committed
ObjectIdentifier needs to be fast and is trivial
1 parent c23215b commit 397c22b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stdlib/public/core/ObjectIdentifier.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
///
1515
/// In Swift, only class instances and metatypes have unique identities. There
1616
/// is no notion of identity for structs, enums, functions, or tuples.
17-
@_fixed_layout // FIXME(sil-serialize-all)
17+
@_fixed_layout // trivial-implementation
1818
public struct ObjectIdentifier {
19-
@usableFromInline // FIXME(sil-serialize-all)
19+
@usableFromInline // trivial-implementation
2020
internal let _value: Builtin.RawPointer
2121

2222
/// Creates an instance that uniquely identifies the given class instance.
@@ -47,15 +47,15 @@ public struct ObjectIdentifier {
4747
/// // Prints "false"
4848
///
4949
/// - Parameter x: An instance of a class.
50-
@inlinable // FIXME(sil-serialize-all)
50+
@inlinable // trivial-implementation
5151
public init(_ x: AnyObject) {
5252
self._value = Builtin.bridgeToRawPointer(x)
5353
}
5454

5555
/// Creates an instance that uniquely identifies the given metatype.
5656
///
5757
/// - Parameter: A metatype.
58-
@inlinable // FIXME(sil-serialize-all)
58+
@inlinable // trivial-implementation
5959
public init(_ x: Any.Type) {
6060
self._value = unsafeBitCast(x, to: Builtin.RawPointer.self)
6161
}
@@ -69,14 +69,14 @@ extension ObjectIdentifier : CustomDebugStringConvertible {
6969
}
7070

7171
extension ObjectIdentifier: Equatable {
72-
@inlinable // FIXME(sil-serialize-all)
72+
@inlinable // trivial-implementation
7373
public static func == (x: ObjectIdentifier, y: ObjectIdentifier) -> Bool {
7474
return Bool(Builtin.cmp_eq_RawPointer(x._value, y._value))
7575
}
7676
}
7777

7878
extension ObjectIdentifier: Comparable {
79-
@inlinable // FIXME(sil-serialize-all)
79+
@inlinable // trivial-implementation
8080
public static func < (lhs: ObjectIdentifier, rhs: ObjectIdentifier) -> Bool {
8181
return UInt(bitPattern: lhs) < UInt(bitPattern: rhs)
8282
}
@@ -97,7 +97,7 @@ extension ObjectIdentifier: Hashable {
9797
extension UInt {
9898
/// Creates an integer that captures the full value of the given object
9999
/// identifier.
100-
@inlinable // FIXME(sil-serialize-all)
100+
@inlinable // trivial-implementation
101101
public init(bitPattern objectID: ObjectIdentifier) {
102102
self.init(Builtin.ptrtoint_Word(objectID._value))
103103
}
@@ -106,7 +106,7 @@ extension UInt {
106106
extension Int {
107107
/// Creates an integer that captures the full value of the given object
108108
/// identifier.
109-
@inlinable // FIXME(sil-serialize-all)
109+
@inlinable // trivial-implementation
110110
public init(bitPattern objectID: ObjectIdentifier) {
111111
self.init(bitPattern: UInt(bitPattern: objectID))
112112
}

0 commit comments

Comments
 (0)