-
Notifications
You must be signed in to change notification settings - Fork 769
[NFC][SYCL] Fix some uses of stringref& and qualtype& #3504
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
Identified elsewhere, these are a few cases of 'simple' types that are intended to be copied being passed around as const references. This patch just replaces them. Also, StringRefs for can be just llvm::StringLiteral for literals, since that does constexpr construction.
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!
Another cleanup for the file would be to remove clang::
and llvm::
prefixes.
I'm the worst, so I have another big patch coming as soon as it validates ;) We can't lose 'llvm::StringLiteral' unfortunately, since clang::StringLiteral is a thing. |
… constexpr construction
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
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
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, thanks Erich.
template <size_t N> | ||
static constexpr DeclContextDesc MakeDeclContextDesc(Decl::Kind K, | ||
const char (&Str)[N]) { | ||
return DeclContextDesc{K, llvm::StringLiteral{Str}}; |
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.
Clang doesn't compile this code:
/home/runner/work/llvm/llvm/src/clang/lib/Sema/SemaSYCL.cpp:76:31: error: no matching constructor for initialization of 'llvm::StringLiteral'
return DeclContextDesc{K, llvm::StringLiteral{Str}};
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.
Ah, I see! I'll push a fixing patch for this ASAP.
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.
Huh... well something strange is going on with this @bader. As far as I can tell, that code should be completely valid, and it is odd it only happens in that single configuration. I can't reproduce it in other configs either (nor does googling the important note give any hint).
That said, I've fixed it in this commit here: #3520
I'm not sure what causes this to not like this conversion, the error message seems incorrect and only on certain configs of the build, but we should fix the build anyway. This calls the StringRef pointer-size directly, rather than having the StringLiteral type do it.
I'm not sure what causes this to not like this conversion, the error message seems incorrect and only on certain configs of the build, but we should fix the build anyway. This calls the StringRef pointer-size directly, rather than having the StringLiteral type do it.
* upstream/sycl: (39 commits) [CI] Switch to default clang-format version. (intel#3540) [Driver][NFC] Cleanup some option setting for SYCL offload (intel#3542) [GitHub Actions] Update main branch sync schedule [SYCL][NFC] Fix potential namespace conflicts with PSTL in tuple.hpp (intel#3541) [SYCL] Bump sycl library minor version (intel#3538) [SYCL][CUDA] Implemented cuda_piextUSMEnqueueMemAdvise (intel#3365) [SYCL][FPGA] Add mutual diagnostic of max_concurrency attribute in conjunction of disable_loop_pipelining attribute (intel#3512) [SYCL] [MATRIX] Enable joint_matrix_load, joint_matrix_store, and joint_matrix_mad for AMX (intel#3503) [ESIMD] Skip rewriting functions used through function pointers (intel#3527) [SYCL] Fix address space for spec constants buffer (intel#3521) [SYCL] Correct the tablegen for checking mutually exclusive stmt attrs (intel#3519) [SYCL][PI][L0][NFC] Refactor setting of LastCommandEvent (intel#3528) [SYCL] Fix group local memory sharing issue (intel#3489) [SYCL][NFC] Fix post-commit failure (intel#3532) [SYCL][Doc] Remove extension mechanism (intel#3526) [SYCL] Move sycl.hpp in install directory and adjust driver to match (intel#3523) [SYCL][ESIMD] Update ESIMD docs to address recent user comments: (intel#3516) [NFCI][SYCL] Correct -fdeclare-spirv-builtins to use marshalling (intel#3515) [SYCL] Rework MarkDevice and children (intel#3475) [SYCL] Fix StringLiteral Ctor issue from intel#3504. (intel#3520) ...
Identified elsewhere, these are a few cases of 'simple' types that are
intended to be copied being passed around as const references. This
patch just replaces them.
Also, StringRefs for can be just llvm::StringLiteral for literals, since
that does constexpr construction.