[PATCH] D126540: PowerPC] Emit warning for incompatible vector types that are currently diagnosed with -fno-lax-vector-conversions

Lei Huang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 10:46:56 PDT 2022


lei added a comment.

Please document all new functions added.



================
Comment at: clang/lib/Sema/SemaExpr.cpp:7715
 
+bool Sema::areAnyVectorTypesAltivec(QualType SrcTy, QualType DestTy) {
+  assert(DestTy->isVectorType() || SrcTy->isVectorType());
----------------
amyk wrote:
> Can we add some brief documentation for this function, like what is done for other functions in this file?
feels like this should be written to just take either 1 param or multiple params via vararg.. since the 2 arg are not really related in any way.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:9567
+          if (areAnyVectorTypesAltivec(RHSType, LHSType) &&
+	      !areVectorTypesSameElmType(RHSType, LHSType))
+            Diag(RHS.get()->getExprLoc(), diag::warn_deprecated_lax_vec_conv_all)
----------------
clang-format


================
Comment at: clang/lib/Sema/SemaExpr.cpp:10519
+      if (areAnyVectorTypesAltivec(RHSType, LHSType) &&
+	  !areVectorTypesSameElmType(RHSType, LHSType))
+        Diag(Loc, diag::warn_deprecated_lax_vec_conv_all) << RHSType << LHSType;
----------------
clang-format


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126540



More information about the cfe-commits mailing list