-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[runtime] Always use SwiftCC #13311
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
[runtime] Always use SwiftCC #13311
Conversation
@gparker42 How does this look? Whichever of this and #13299 is merged second will need to be rebased, but that shouldn't be a major task. |
Do we gain much from the Config.h / PublicConfig.h split? We might be better off leaving Config.h as-is and adding the swiftcall enforcement to a non-header file. |
Either way let's do the other change first. |
That's probably true, actually. I'm not sure which file it'd fit into, but that'd be easy to do and shrink this PR pretty significantly. If we wanted to move it into another header file HeapObject.h looks like it's runtime only and is the reason for the check, so maybe that would be a candidate? I guess equally an argument could be made for HeapObject.cpp. |
f452a1e
to
bf4d1e5
Compare
I've shifted the check into HeapObject.cpp and reverted the split of Config.h. This should be a much simpler change now. |
Yes, I like this way better. Thomas, can you run this test locally: change |
@swift-ci please test |
Build failed |
Build failed |
That's a little tricky – we need the Config.h header to be correct for the runtime, since we're assuming that I've also started up a gcc-based build on the Ubuntu image, but that might take a few hours to complete. I'll report back once that's done. |
Good, that should cover it. |
While these macros shouldn't be used outside of the runtime, runtime headers are still pulled in from compiler code. Empty-define these macros so that code can still compile.
Looks like I missed something: while the That's the same error that the Linux test caught: it's using a version of Clang that doesn't have As an aside, compiling Swift on GCC is surprisingly difficult: MSVC support has been special-cased in a few places but the code generally assumes Clang or MSVC. I'm not sure how worthwhile maintaining that support will be in the future, but that's a different issue. |
@swift-ci please test |
Once #13299 is merged, it will silently cause issues on some platforms if the Swift calling convention is not available.
Therefore, since every platform that Swift supports also supports the Swift calling convention, we should always use the Swift calling convention, as per discussion at #13299 (comment).
To do this, I've split some of the runtime
Config.h
header (which was being included by some sources outside of the stdlib/runtime) out into a newPublicConfig.h
header, which can safely be included in non-runtime code whether or not the host compiler supportsswiftcall
.I've added checks within the internal
Config.h
header that the compiler in use for the runtime supportsswiftcall
. I've also removed anyUseSwiftCC
checks as they're now redundant.