[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG52e8f58d49e6: [SYCL] Diagnose uses of zero length arrays (authored by Fznamznon). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-16 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. I hope that someone not from Intel will take a look as well. If this won't happen for reasonable amount of time, I'll submit this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-14 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 _

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-06 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 392080. Fznamznon added a comment. Applied suggestions from Aaron Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 Files: clang/include/clang/Basic/DiagnosticSemaK

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Just a few minor nits from me. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:11395-11396 InGroup; +def err_sycl_zero_array_size : Error< + "zero-length arrays are not permitted in SYCL device code">; We should

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-12-06 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. In D114080#3158368 , @Fznamznon wrote: > In D114080#3158323 , @erichkeane > wrote: > >> I note that this is missing a test, otherwise I don't see any issues with it >> from my end. > >

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 390376. Fznamznon added a comment. An attempt to fix review page Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 Files: clang/include/clang/Basic/DiagnosticSemaKi

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. In D114080#3158323 , @erichkeane wrote: > I note that this is missing a test, otherwise I don't see any issues with it > from my end. There is a test SemaSYCL/zero-length-arrays.cpp. For some reason after I updated this revi

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. I note that this is missing a test, otherwise I don't see any issues with it from my end. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 _

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon marked an inline comment as not done. Fznamznon added inline comments. Comment at: clang/lib/Sema/SemaSYCL.cpp:68-75 +bool ErrorFound = false; +if (isZeroSizedArray(*this, TypeToCheck)) { + SYCLDiagIfDeviceCode(UsedAt, diag::err_sycl_zero_array_size); +

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-29 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 390346. Fznamznon marked an inline comment as done. Fznamznon added a comment. Apply suggestion from @bader Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 Files:

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-25 Thread Alexey Bader via Phabricator via cfe-commits
bader added a comment. LGTM, with a couple of minor suggestions. Comment at: clang/lib/Sema/SemaSYCL.cpp:68-75 +bool ErrorFound = false; +if (isZeroSizedArray(*this, TypeToCheck)) { + SYCLDiagIfDeviceCode(UsedAt, diag::err_sycl_zero_array_size); + ErrorFound =

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. > I agree, but having a field defined is different from it being used. It is > actually not uncommon to see SYCL functor passed with many unused fields > (Eigen is good example). Are you saying that it is better to diagnose just used fields? I believe it is safer to d

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Victor Lomuller via Phabricator via cfe-commits
Naghasan added a comment. In D114080#3137480 , @aaron.ballman wrote: > In D114080#3137462 , @Naghasan > wrote: > >> right, TIL `sizeof (ContainsArr)` is 0 according to clang. I can see trouble >> arising. >> >>

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. In D114080#3137430 , @Naghasan wrote: > Why the need for this restriction ? Zero length arrays are not supported by pure C++. It is an extension supported by clang. They are also not allowed in OpenCL and SPIR-V, and I even th

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D114080#3137462 , @Naghasan wrote: > right, TIL `sizeof (ContainsArr)` is 0 according to clang. I can see trouble > arising. > > @aaron.ballman maybe you know better, is that intended for the extension ? I don't *know*,

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Victor Lomuller via Phabricator via cfe-commits
Naghasan added a comment. right, TIL `sizeof (ContainsArr)` is 0 according to clang. I can see trouble arising. @aaron.ballman maybe you know better, is that intended for the extension ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ h

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Victor Lomuller via Phabricator via cfe-commits
Naghasan added a comment. Why the need for this restriction ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.llvm.org/D114080 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. @jdoerfert , @yaxunl , please let me know if similar thing would be useful for OMP/HIP/CUDA as well. I can generalize it by using `targetDiag`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114080/new/ https://reviews.ll

[PATCH] D114080: [SYCL] Diagnose uses of zero length arrays

2021-11-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon created this revision. Herald added subscribers: Naghasan, Anastasia, ebevhan, yaxunl. Fznamznon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Adds diagnosing on attempt to use zero length arrays, pointers, refs, arrays of them