-
Notifications
You must be signed in to change notification settings - Fork 788
[clangd] Avoid clangd crash with -fsycl flag #11795
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
Not sure who the reviewers for this should be. |
Yea me neither. @bader the FE team does not have experience with clangd. Who should the code owners be for this PR? |
I don't know anyone who works with clangd on this project. Considering that this is a clang tool @intel/dpcpp-cfe-reviewers is the best option we have. Based on the changes I guess @intel/dpcpp-clang-driver-reviewers team might be able to help, but I don't know if clangd shares any logic with the clang driver. |
Add four extra option resets in disableUnsupportedOptions when parsing SYCL code. All four are needed to make clangd happily parse code when -fsycl is specified in compile commands. Without each of them, the following happens: * without SYCLIsDevice=false: crash on !nullptr assert * without DeclareSPIRVBuiltins=false: crash on !nullptr assert * without SYCLUnnamedLambda=false: ref_non_value error, 'T' does not refer to a value * without Triple=HostTriple: pp_file_not_found error, 'gnu/stubs-32.h' file not found Fixes intel#11088 and clangd/clangd#1097
05e7395
to
99a228f
Compare
@intel/dpcpp-cfe-reviewers I would appreciate any further review comments or launching the tests if this version looks OK. |
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.
LGTM
Add four extra option resets in
disableUnsupportedOptions
when parsing SYCL code. All four are needed to make clangd happily parse code when-fsycl
is specified in compile commands. Without each of them, the following happens:SYCLIsDevice=false
: crash on !nullptr assertDeclareSPIRVBuiltins=false
: crash on !nullptr assertSYCLUnnamedLambda=false
:ref_non_value
error,'T' does not refer to a value
Triple=HostTriple
:pp_file_not_found
error,'gnu/stubs-32.h' file not found
Fixes #11088 and clangd/clangd#1097
Also add a LIT test which parses the following code:
and checks
symbolInfo
for the symbolq
against a reference.