[PATCH] D33353: [OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 12:02:12 PDT 2017


Anastasia added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8307
   "variable length arrays are not supported in OpenCL">;
+def err_scalar_type_rank_greater_than_vector_type : Error<
+    "scalar operand type has greater rank than the type of the vector "
----------------
Since it's OpenCL specific rule, could we rename:
  err_scalar_type_rank_greater_than_vector_type -> err_opencl_scalar_type_rank_greater_than_vector_type


================
Comment at: lib/Sema/SemaExpr.cpp:8344
   // the vector element type and splat.
+  unsigned DeclID = 0;
   if (!RHSVecType) {
----------------
Could we initialize this with `diag::err_typecheck_vector_not_convertable` and then just use default return with empty QualType at the end of the function instead of adding an extra one in lines 8369-8374?


https://reviews.llvm.org/D33353





More information about the cfe-commits mailing list