This revision was automatically updated to reflect the committed changes.
Closed by commit rL261719: [OpenCL] Add Sema checks for OpenCL 2.0 block
(authored by pxl).
Changed prior to commit:
http://reviews.llvm.org/D17436?vs=48774&id=48880#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17
Anastasia added inline comments.
Comment at: test/SemaOpenCL/invalid-block.cl:17
@@ +16,3 @@
+void f2(BlkInt *BlockPtr) {
+ BlkInt B = ^int(int I) {return 1;};
+ BlkInt *P = &B; // expected-error {{invalid argument type 'BlkInt' (aka 'int
(^)(int)') to unary expression}}
--
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM!
http://reviews.llvm.org/D17436
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo
pxli168 added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:6714
@@ +6713,3 @@
+ if (LangOpts.OpenCLVersion >= 200 && T->isBlockPointerType()) {
+const BlockPointerType *BlkTy = T->getAs();
+const FunctionProtoType *FTy =
Anastasia wrote:
> Yes, but
pxli168 updated this revision to Diff 48774.
http://reviews.llvm.org/D17436
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaType.cpp
test/SemaOpenCL/invalid-block.cl
Index: test/SemaOpenCL/invalid-block.cl
=
Anastasia added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:6714
@@ +6713,3 @@
+ if (LangOpts.OpenCLVersion >= 200 && T->isBlockPointerType()) {
+const BlockPointerType *BlkTy = T->getAs();
+const FunctionProtoType *FTy =
Yes, but you have to diagn
pxli168 updated this revision to Diff 48648.
http://reviews.llvm.org/D17436
Files:
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaType.cpp
test/SemaOpenCL/invalid-block.cl
Index: test/SemaOpenCL/invalid-block.cl
=
pxli168 marked 11 inline comments as done.
pxli168 added a comment.
Block is an OpenCL v2.0 feature, I think all test should be handled only for
CL2.0 or newer version.
Comment at: lib/Sema/SemaDecl.cpp:6714
@@ +6713,3 @@
+ // supported in OpenCL C: Blocks with variadic argume
Anastasia added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:7719
@@ +7718,3 @@
+def err_opencl_block_proto_variadic : Error<
+ "invalid block prototype, variadic arguments are not allowed in opencl">;
+def err_opencl_invalid_block_array : Error<
--