[PATCH] D24669: {Sema] Gcc compatibility of vector shift.

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 11:16:07 PDT 2016


bruno added a reviewer: bruno.
bruno added inline comments.


================
Comment at: llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td:2306
+  "vector operands do not have the same elements sizes (%0 and %1)">,
+  InGroup<DiagGroup<"gnu-vec-elem-size">>, DefaultError;
 def err_ext_vector_component_exceeds_length : Error<
----------------
Although the motivation is to support the same warning present in GCC, I think this is helpful enough anyway so that we might skip calling it "gnu-vec-elem-size" and have a more generic name instead? How about plain "vec-elem-size"?


================
Comment at: llvm/tools/clang/lib/Sema/SemaExpr.cpp:8787
     }
+    if (!S.LangOpts.OpenCL && !S.LangOpts.ZVector) {
+      const BuiltinType *LHSBT = LHSEleType->getAs<clang::BuiltinType>();
----------------
Besides `__ext_vector_type__`, would this also trigger for `vector_size`? Right now this is an error for `vector_size` primarily because the number of elements is different, can you confirm this won't change?


https://reviews.llvm.org/D24669





More information about the cfe-commits mailing list