-
Notifications
You must be signed in to change notification settings - Fork 10.5k
tools: disable ObjC for wasm in SILFunctionExtractor #31920
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
This really should mirror the behaviour from the driver |
Right. In general, |
Would you prefer |
Both actually, it should have |
8b33220
to
0c6a2b5
Compare
Thanks for the review, that's addressed now. |
@swift-ci please smoke test |
@@ -249,6 +254,8 @@ int main(int argc, char **argv) { | |||
Invocation.getLangOptions().DisableAvailabilityChecking = true; | |||
Invocation.getLangOptions().EnableAccessControl = false; | |||
Invocation.getLangOptions().EnableObjCAttrRequiresFoundation = false; | |||
Invocation.getLangOptions().EnableObjCInterop = | |||
Invocation.getLangOptions().Target.isOSDarwin() || EnableObjCInterop; |
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.
EnableObjCInterop
should take precedent over Target.isOSDarwin()
. That is, I should be able to disable ObjC interop even on Darwin.
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.
Is there any way to check if EnableObjCInterop
was defined or not as a command-line argument? I had a look in LLVM docs, and looks like the only options for bool
CL arguments are true
or false
(with false
as the default) with no way to determine if it was explicitly passed or not.
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.
Got it, llvm::cl::boolOrDefault
does the job.
0c6a2b5
to
2a220e1
Compare
@swift-ci please smoke test |
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.
This looks pretty good. But can we match sil-opt where you can explicitly disable as well. https://github.com/apple/swift/blob/d5e5253cee0599a5362363d6ba0fe640493ea0e6/tools/sil-opt/SILOpt.cpp#L419
@CodaFi were you looking at the old diff by any chance? With 2a220e1 that's exactly how it works, if I understand correctly. Or do you want to have a separate |
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
@swift-ci please smoke test |
@swift-ci please smoke test Linux platform |
This check is no longer needed since Wasm handling was addressed upstream in swiftlang#31920
Currently,
clang
doesn't support Objective-C with the WebAssembly object format. Because of this,sil-function-extractor
tool crashes in Clang'sCGObjCCommonMac::GetSectionName
function. Since Swift doesn't provide Objective-C interop for WebAssembly, it would make sense to disable it explicitly.sil-function-extractor
is used in the test suite, so this PR is required for those tests to proceed when testing the WebAssembly toolchain and SDK.Related to SR-9307.
(cc @compnerd)