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

Vladimir Yakovlev via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 06:34:15 PDT 2016


vbyakovlcl 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<
----------------
bruno wrote:
> 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"?
I'm agree.


================
Comment at: llvm/tools/clang/lib/Sema/SemaExpr.cpp:8787
     }
+    if (!S.LangOpts.OpenCL && !S.LangOpts.ZVector) {
+      const BuiltinType *LHSBT = LHSEleType->getAs<clang::BuiltinType>();
----------------
bruno wrote:
> 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?
I compare vector element sizes, so there must not be any differencies caused by different triggers. I added additional type definitions to the tests. All compiles fain.


https://reviews.llvm.org/D24669





More information about the cfe-commits mailing list