Skip to content

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

Merged
merged 3 commits into from
May 28, 2016
Merged

Halt #372

merged 3 commits into from
May 28, 2016

Conversation

compnerd
Copy link
Member

No description provided.

compnerd added 3 commits May 17, 2016 19:15
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__)
Copy link
Contributor

@parkera parkera May 18, 2016

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__?

Copy link
Member Author

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.

@parkera
Copy link
Contributor

parkera commented May 19, 2016

@swift-ci please test

@compnerd
Copy link
Member Author

The failure seems unrelated to this change.

@compnerd
Copy link
Member Author

Ping?

@parkera
Copy link
Contributor

parkera commented May 24, 2016

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.

@compnerd
Copy link
Member Author

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).

@compnerd compnerd mentioned this pull request May 28, 2016
@parkera
Copy link
Contributor

parkera commented May 28, 2016

I think the CI problem is cleared up now (compiler bug). I'll try this again.

@parkera
Copy link
Contributor

parkera commented May 28, 2016

@swift-ci please test

@parkera parkera merged commit 8aa52e2 into swiftlang:master May 28, 2016
russbishop pushed a commit to russbishop/swift-corelibs-foundation that referenced this pull request May 31, 2016
* 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.
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants