-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Halt #372
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
Halt #372
Conversation
The two branches are identical and just define the same macro on different architectures. Collapse them to simplify. Yes, Windows is supported on all those architectures.
Windows could be using a GNU compatible compiler (i.e. clang). In such a scenario, assume that __builtin_unreachable() is available (any newer clang or gcc would suffice). However, since we require clang for swift, it makes sense to require clang for Foundation build. The minimal require clang already has __builtin_unreachable supported. On a non-GNU-like compiler, use the MSVC intrinsic `__assume` which gives a proper `__builtin_unreachable` equivalent.
Use another macro to make the two cases more similar. NFC.
@@ -158,22 +158,17 @@ CF_PRIVATE CFIndex __CFActiveProcessorCount(); | |||
#endif | |||
|
|||
#if DEPLOYMENT_TARGET_WINDOWS | |||
#define __builtin_unreachable() do { } while (0) | |||
#if !defined(__GNUC__) |
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.
Why not use _MSC_VER
here as below, instead of looking for !__GNUC__
?
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.
Because you could be using a GNU compatible compiler on Windows (e.g. clang). -windows- other than windows-msvc will define GNU even though the code is being compiled for Windows.
@swift-ci please test |
The failure seems unrelated to this change. |
Ping? |
I'm reluctant to merge anything in while we're still trying to figure out the root cause of the CFNumber failure currently hitting CI. |
I didn't realize that there were still CI issues. Sorry for the noise (I thought they had been resolved and this was just forgotten). |
I think the CI problem is cleared up now (compiler bug). I'll try this again. |
@swift-ci please test |
* Base: collapse two CPP branches The two branches are identical and just define the same macro on different architectures. Collapse them to simplify. Yes, Windows is supported on all those architectures. * Base: tweak __builtin_unreachable on Windows Windows could be using a GNU compatible compiler (i.e. clang). In such a scenario, assume that __builtin_unreachable() is available (any newer clang or gcc would suffice). However, since we require clang for swift, it makes sense to require clang for Foundation build. The minimal require clang already has __builtin_unreachable supported. On a non-GNU-like compiler, use the MSVC intrinsic `__assume` which gives a proper `__builtin_unreachable` equivalent. * Base: spell DebugBreak __builtin_trap Use another macro to make the two cases more similar. NFC.
[pull] swiftwasm from main
No description provided.