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
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:
>
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
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:
>
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
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:
>
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:
>
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
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
--
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
---
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
11 matches
Mail list logo