File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 2121#include "SwiftStdbool.h"
2222#include "SwiftStddef.h"
2323#include "SwiftStdint.h"
24+ #include "SwiftStdbool.h"
2425#include "Visibility.h"
2526
2627#ifdef __cplusplus
@@ -62,6 +63,12 @@ int _swift_stdlib_putc_stderr(int C);
6263SWIFT_RUNTIME_STDLIB_API
6364__swift_size_t _swift_stdlib_getHardwareConcurrency (void );
6465
66+ #ifdef __swift__
67+ /// Called by ReflectionMirror in stdlib through C-calling-convention
68+ SWIFT_RUNTIME_STDLIB_API
69+ __swift_bool swift_isClassType (const void * type );
70+ #endif
71+
6572/// Manually allocated memory is at least 16-byte aligned in Swift.
6673///
6774/// When swift_slowAlloc is called with "default" alignment (alignMask ==
Original file line number Diff line number Diff line change 1414
1515import SwiftShims
1616
17- @_silgen_name ( " swift_isClassType " )
18- internal func _isClassType( _: Any . Type ) -> Bool
17+ internal func _isClassType( _ type: Any . Type ) -> Bool {
18+ // a thick metatype is represented with a pointer metadata structure,
19+ // so this unsafeBitCast is a safe operation here.
20+ return swift_isClassType ( unsafeBitCast ( type, to: UnsafeRawPointer . self) )
21+ }
1922
2023@_silgen_name ( " swift_getMetadataKind " )
2124internal func _metadataKind( _: Any . Type ) -> UInt
You can’t perform that action at this time.
0 commit comments