-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[shims] Move bit masks to SwiftShims and include/swift/ABI. #12306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
#define SWIFT_ABI_S390X_SWIFT_SPARE_BITS_MASK 0x0000000000000007ULL | ||
|
||
#endif /* SWIFT_ABI_SYSTEM_H */ | ||
#endif // __SWIFT_ABI_SYSTEM_H__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline at end of file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks for centralizing these magic numbers!
Move bits mask from Metadata.h to SwiftShims's HeapObject.h. This exposes the bit masks to the stdlib, so that the stdlib doesn't have to have its own magic numbers per-platform. This also enhances readability for BridgeObject, whose magic numbers are mostly derived from Swift's ABI.
ee08fc7
to
3d04fb5
Compare
@swift-ci please test |
Build failed |
Build failed |
/// Corresponding namespaced decls | ||
#ifdef __cplusplus | ||
namespace heap_object_abi { | ||
static const uintptr_t LeastValidPointerValue = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be __swift_uintptr_t
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, what is the point of __swift_uintptr_t
? My guess was that __swift_uintptr_t
was so that it would be specially imported to the stdlib as UInt
rather than UInt<n>
. If that's the case, then this isn't visible to the stdlib as it's C++. I'm happy to make the style match, I'm just curious whether there's something more going on here.
edit: formatting and grammar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is given in SwiftStdint.h. Briefly: it breaks a dependency cycle on Darwin and avoids a tools bug on Linux.
@swift-ci please smoke test |
Move bits mask from Metadata.h to SwiftShims's HeapObject.h. This
exposes the bit masks to the stdlib, so that the stdlib doesn't have
to have its own magic numbers per-platform. This also enhances
readability for BridgeObject, whose magic numbers are mostly derived
from Swift's ABI.