[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-22 Thread Alexey Bader via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe95ee300c053: [SYCL] Prohibit arithmetic operations for incompatible pointers (authored by bader). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80317/new/

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 265579. bader marked an inline comment as done. bader added a comment. Fix formatting in clang/test/Sema/address_spaces.c Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80317/new/ https://reviews.llvm.org/D80317

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM Comment at: clang/include/clang/AST/Type.h:1069 + /// qualifiers. + bool isAddressSpaceOverlapping(const QualType &T) const { +Qualifiers Q = getQualifiers();

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread Alexey Bader via Phabricator via cfe-commits
bader marked 2 inline comments as done. bader added inline comments. Comment at: clang/include/clang/AST/Type.h:1069 + /// qualifiers. + bool isAddressSpaceOverlapping(const QualType &T) const { +Qualifiers Q = getQualifiers(); rjmccall wrote: > It's idioma

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 265547. bader added a comment. - Added C test case with address_space attribute. - Move isAddressSpaceOverlapping from PointerType to QualType. - Move C++ test case to clang/test/SemaCXX Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Please add a C test case just using the address_space attribute. Comment at: clang/include/clang/AST/Type.h:1069 + /// qualifiers. + bool isAddressSpaceOverlapping(const QualType &T) const { +Qualifiers Q = getQualifiers(); It's

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread Alexey Bader via Phabricator via cfe-commits
bader marked 2 inline comments as done. bader added a comment. Thanks for the review. I've enabled the diagnostics for all the modes. I also applied the refactoring suggested by @rjmccall. Hopefully I understand it correctly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread Alexey Bader via Phabricator via cfe-commits
bader updated this revision to Diff 265487. bader added a comment. Enable diagnostics for non-OpenCL modes and applied refactoring proposed by John. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80317/new/ https://reviews.llvm.org/D80317 Files:

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:10090 // if both are pointers check if operation is valid wrt address spaces - if (S.getLangOpts().OpenCL && isLHSPointer && isRHSPointer) { + if ((S.getLangOpts().OpenCL || S.getLangOpts().SYCLIsDevice)

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added subscribers: jeroen.dobbelaere, rjmccall. Anastasia added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:10090 // if both are pointers check if operation is valid wrt address spaces - if (S.getLangOpts().OpenCL && isLHSPointer && isRHSPointer) { + i

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-20 Thread Alexey Bader via Phabricator via cfe-commits
bader created this revision. bader added a reviewer: Anastasia. Herald added subscribers: cfe-commits, ebevhan, yaxunl. Herald added a project: clang. bader marked an inline comment as done. bader added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:10090 // if both

[PATCH] D80317: [SYCL] Prohibit arithmetic operations for incompatible pointers

2020-05-20 Thread Alexey Bader via Phabricator via cfe-commits
bader marked an inline comment as done. bader added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:10090 // if both are pointers check if operation is valid wrt address spaces - if (S.getLangOpts().OpenCL && isLHSPointer && isRHSPointer) { + if ((S.getLangOpts().Op