[PATCH] D71463: Implement VectorType conditional operator GNU extension.

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 27 09:00:34 PST 2019


Anastasia added a comment.

It looks good, I was just thinking whether it would be possible to share more common infrastructure. There is `Sema::CheckVectorOperands` that corresponding OpenCL methods are using internally. Do you think it is possible to share the code more?



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6880
+def err_conditional_vector_has_void : Error<
+  "GNU vector conditional operand cannot be %select{void|a throw expression}0">;
+def err_conditional_vector_operand_type
----------------
Would this only apply to GNU extension? I am just wondering if this can be generalized.


================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:5797
+    // If both are vector types, they must be the same type.
+    if (!Context.hasSameType(LHSType, RHSType)) {
+      Diag(QuestionLoc, diag::err_conditional_vector_mismatched_vectors)
----------------
Don't we already have a diagnostic for this used in OpenCL?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71463/new/

https://reviews.llvm.org/D71463





More information about the cfe-commits mailing list