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

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 09:55:59 PST 2016


Anastasia 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 =
----------------
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 

================
Comment at: lib/Sema/SemaExpr.cpp:6509
@@ +6508,3 @@
+      return QualType();
+  }
+
----------------
What is the implication of that? Will we get errors in different order then?


http://reviews.llvm.org/D17436





More information about the cfe-commits mailing list