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 21
21
#include "SwiftStdbool.h"
22
22
#include "SwiftStddef.h"
23
23
#include "SwiftStdint.h"
24
+ #include "SwiftStdbool.h"
24
25
#include "Visibility.h"
25
26
26
27
#ifdef __cplusplus
@@ -62,6 +63,12 @@ int _swift_stdlib_putc_stderr(int C);
62
63
SWIFT_RUNTIME_STDLIB_API
63
64
__swift_size_t _swift_stdlib_getHardwareConcurrency (void );
64
65
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
+
65
72
/// Manually allocated memory is at least 16-byte aligned in Swift.
66
73
///
67
74
/// When swift_slowAlloc is called with "default" alignment (alignMask ==
Original file line number Diff line number Diff line change 14
14
15
15
import SwiftShims
16
16
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
+ }
19
22
20
23
@_silgen_name ( " swift_getMetadataKind " )
21
24
internal func _metadataKind( _: Any . Type ) -> UInt
You can’t perform that action at this time.
0 commit comments