-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[WIP] [Parse] Add _pointer_bit_width platform condition #14413
Conversation
@swift-ci Please smoke test Linux platform |
At the same time as I objected to the other PR, I'm leery of adding this even as an underscored condition because people will start using it. Seems like someone should just take this through Evolution. |
@swift-ci Please clean smoke test Linux platform |
@jrose-apple I see your point. I think if there's broad consensus that this is necessary for the stdlib, however, then an underscored condition wouldn't be terrible as long as we intend to make it public eventually anyway. At the moment I'm rather flummoxed by the technical issue that this seemingly straightforward addition doesn't seem to work. I wonder if it's the integer values that aren't being parsed correctly. |
Yeah, the current grammar for platform conditions always expects a single identifier as the argument. You could use |
@swift-ci Please smoke test Linux platform |
Endianness, | ||
/// The active arch target pointer bit width (_32 or _64) | ||
PointerBitWidth, |
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.
Cf. __POINTER_WIDTH__
in Clang, getArchPointerBitWidth
in LLVM, target_pointer_width
in Rust.
@swift-ci Please smoke test OS X platform |
@xwu If you still want to pursue this, could you rebase it and take it through evolution? Also, if you wouldn't mind adding a Parse test for a bogus condition value. |
Alright, it's been 4 months without a reply. I'm closing this due to age and inactivity. |
It's entirely slipped my mind. Will revisit this topic later in the year, time permitting. Thanks @CodaFi! |
Instead of explicitly listing each platform when testing for the native word size (which, per documentation, is the bit width of
Int
), add an explicit (underscored) platform conditional.This supersedes the solution discussed in #14386 and #14409.