[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia closed this revision. Anastasia added a comment. Committed in r344148. The review link was forgotten and therefore didn't get closed automatically. https://reviews.llvm.org/D52598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-09 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { +const PointerType *DestPtr = DestType->getAs(); +if (!DestPtr->isAddressSpaceOverlapping(*SrcType->getAs())) { rjmccall wrote: > Anastasia wrote: >

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-08 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: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { +const PointerType *DestPtr = DestType->getAs(); +if (!DestPtr->isAddressSpaceOver

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-08 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { +const PointerType *DestPtr = DestType->getAs(); +if (!DestPtr->isAddressSpaceOverlapping(*SrcType->getAs())) { rjmccall wrote: > Anastasia wrote: >

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-08 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 168633. Anastasia added a comment. - Changed to pass `QualType` by value. - Improved description of new method. - Added a comment about the OpenCL rules. https://reviews.llvm.org/D52598 Files: lib/Sema/SemaCast.cpp test/SemaOpenCL/address-spaces-conve

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { +const PointerType *DestPtr = DestType->getAs(); +if (!DestPtr->isAddressSpaceOverlapping(*SrcType->getAs())) { Anastasia wrote: > Anastasia wrote: >

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaCast.cpp:2288 + SrcType->isPointerType()) { +const PointerType *DestPtr = DestType->getAs(); +if (!DestPtr->isAddressSpaceOverlapping(*SrcType->getAs())) { Anastasia wrote: > rjmccall wrote: >

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 168471. Anastasia added a comment. Change AS checking function to be a method of `CastOperation`. https://reviews.llvm.org/D52598 Files: lib/Sema/SemaCast.cpp test/SemaOpenCL/address-spaces-conversions-cl2.0.cl test/SemaOpenCL/address-spaces.cl In

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaCast.cpp:2283 + const QualType &SrcType, + const QualType &DestType) { + // OpenCL v1 s6.5: Casting a pointer to address space A to a pointer to --

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-10-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/Sema/SemaCast.cpp:2283 + const QualType &SrcType, + const QualType &DestType) { + // OpenCL v1 s6.5: Casting a pointer to address space A to a pointer to ---

[PATCH] D52598: [OpenCL] Fixed address space cast in C style cast of C++ parsing

2018-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: rjmccall, yaxunl. C style cast in OpenCL C++ was ignoring the address space conversions from OpenCL C and as a result accepting incorrect code to compile. This commit adds correctness checking for address spaces. This makes all OpenCL C