[SYCL] Prohibit arithmetic operations for incompatible pointers
authorAlexey Bader <alexey.bader@intel.com>
Wed, 20 May 2020 19:22:30 +0000 (22:22 +0300)
committerAlexey Bader <alexey.bader@intel.com>
Fri, 22 May 2020 10:43:24 +0000 (13:43 +0300)
commite95ee300c0530158d86430fd82ffabd36262e862
tree5944d01d34e219633da03e69f75aefa2433c8454
parent872ee78f65f47fae19d4f8db7396eb56d902aef1
[SYCL] Prohibit arithmetic operations for incompatible pointers

Summary:
This change enables OpenCL diagnostics for the pointers annotated with
address space attribute SYCL mode.

Move `isAddressSpaceOverlapping` method from PointerType to QualType.

Reviewers: Anastasia, rjmccall

Reviewed By: rjmccall

Subscribers: rjmccall, jeroen.dobbelaere, Fznamznon, yaxunl, ebevhan, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80317
clang/include/clang/AST/Type.h
clang/lib/Sema/SemaCast.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/address_spaces.c
clang/test/SemaCXX/address-space-arithmetic.cpp [new file with mode: 0644]