[PATCH] D17436: [OpenCL] Add Sema checks for OpenCL 2.0 block

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 20:58:16 PST 2016


pxli168 added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:6714
@@ +6713,3 @@
+  if (LangOpts.OpenCLVersion >= 200 && T->isBlockPointerType()) {
+    const BlockPointerType *BlkTy = T->getAs<BlockPointerType>();
+    const FunctionProtoType *FTy =
----------------
Anastasia wrote:
> Yes, but you have to diagnose blocks correctly in all CL versions in which we accept blocks. When you come to this point here you should only care about checking whether blocks have variadic prototype or not. You should assume the parser did the right job to either accept or reject the block declaration earlier and also gave the right diagnostic.
> 
> It will be responsibility of a parser to correctly accept or reject blocks depending on a version. I will prepare a patch for it later on. Please see my related comment on the review: http://reviews.llvm.org/D16928 
I will change these, if we can restrict -fblock with -cl-std=CL2.x then there will be no problem by only checking LangOpts.OpenCL

================
Comment at: lib/Sema/SemaExpr.cpp:6509
@@ +6508,3 @@
+      return QualType();
+  }
+
----------------
Anastasia wrote:
> What is the implication of that? Will we get errors in different order then?
I think we should put operands check after condition check to keep the original logic.


http://reviews.llvm.org/D17436





More information about the cfe-commits mailing list