@@ -206,13 +206,13 @@ internal func _isClassOrObjCExistential<T>(_ x: T.Type) -> Bool {
206206/// Returns an `UnsafePointer` to the storage used for `object`. There's
207207/// not much you can do with this other than use it to identify the
208208/// object.
209- @_transparent
210- public func unsafeAddress( of object: AnyObject ) -> UnsafeRawPointer {
211- return UnsafeRawPointer ( Builtin . bridgeToRawPointer ( object ) )
209+ @available ( * , unavailable , message : " Removed in Swift 3. Use Unmanaged.passUnretained(x).toOpaque() instead. " )
210+ public func unsafeAddress( of object: AnyObject ) -> UnsafePointer < Void > {
211+ Builtin . unreachable ( )
212212}
213213
214- @available ( * , unavailable, renamed : " unsafeAddress(of:) " )
215- public func unsafeAddressOf( _ object: AnyObject ) -> UnsafeRawPointer {
214+ @available ( * , unavailable, message : " Removed in Swift 3. Use Unmanaged.passUnretained(x).toOpaque() instead. " )
215+ public func unsafeAddressOf( _ object: AnyObject ) -> UnsafePointer < Void > {
216216 Builtin . unreachable ( )
217217}
218218
@@ -293,17 +293,19 @@ public func _onFastPath() {
293293
294294/// Returns `true` iff the class indicated by `theClass` uses native
295295/// Swift reference-counting.
296- @_versioned
297- @inline ( __always)
298- internal func _usesNativeSwiftReferenceCounting( _ theClass: AnyClass ) -> Bool {
299296#if _runtime(_ObjC)
300- return swift_objc_class_usesNativeSwiftReferenceCounting (
301- unsafeAddress ( of: theClass)
302- )
297+ // Declare it here instead of RuntimeShims.h, because we need to specify
298+ // the type of argument to be AnyClass. This is currently not possible
299+ // when using RuntimeShims.h
300+ @_silgen_name ( " swift_objc_class_usesNativeSwiftReferenceCounting " )
301+ func _usesNativeSwiftReferenceCounting( _ theClass: AnyClass ) -> Bool
303302#else
303+ @_versioned
304+ @inline ( __always)
305+ func _usesNativeSwiftReferenceCounting( _ theClass: AnyClass ) -> Bool {
304306 return true
305- #endif
306307}
308+ #endif
307309
308310@_silgen_name ( " swift_class_getInstanceExtents " )
309311func swift_class_getInstanceExtents( _ theClass: AnyClass )
0 commit comments