[PATCH] D17343: [OpenCL] Diagnose program scope pointers
Mandeep Singh Grang via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 17 11:55:14 PST 2016
mgrang added a subscriber: mgrang.
================
Comment at: lib/Sema/SemaDecl.cpp:6605
@@ +6604,3 @@
+ // Program scope pointers can only point to data at the constant or global
+ // address space.
+ const PointerType *PT = nullptr;
----------------
Check alignment of comments.
================
Comment at: lib/Sema/SemaDecl.cpp:6625
@@ +6624,3 @@
+ PT = dyn_cast<const PointerType>(T.getTypePtr());
+ if (PT) {
+ T = PT->getPointeeType();
----------------
Can you combine the assignment to PT inside the if condition? Like:
if (foo = something())
================
Comment at: lib/Sema/SemaDecl.cpp:6629
@@ -6617,1 +6628,3 @@
+ }
+ } while (PT);
} else {
----------------
Any reason why this cannot be a while loop instead of a do..while loop?
http://reviews.llvm.org/D17343
More information about the cfe-commits
mailing list