[PATCH] D126377: [clang][AArch64][SVE] Improve diagnostics for SVE operators

Cullen Rhodes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 00:53:44 PDT 2022


c-rhodes added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:10609-10614
-  if (RHSType->isVLSTBuiltinType() && !LHSType->isVLSTBuiltinType()) {
-    auto DestType = tryScalableVectorConvert((IsCompAssign ? nullptr : &LHS),
-                                             LHSType, RHSType);
-    if (DestType == QualType())
-      return InvalidOperands(Loc, LHS, RHS);
-    return DestType;
----------------
why is this removed?


================
Comment at: clang/lib/Sema/SemaExpr.cpp:10614
+      (!RHSType->isVLSTBuiltinType() && !RHSType->isRealType())) {
+    Diag(Loc, diag::err_typecheck_vector_not_convertable_non_scalar)
+        << LHSType << RHSType << LHS.get()->getSourceRange()
----------------
missing a test for this?


================
Comment at: clang/test/Sema/aarch64-sve-vector-arith-ops.c:23
-  (void)(i8 + f64); // expected-error{{invalid operands to binary expression}}
-  (void)(i8 + 0);   // expected-error{{invalid operands to binary expression}}
-  (void)(i8 + 0l);  // expected-error{{invalid operands to binary expression}}
----------------
I think these vector + imm tests should be removed in D126380 but fine to keep here if it's easier


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126377



More information about the cfe-commits mailing list