[clang] [clang][sema] consolidate diags for incompatible_vector_* (PR #83609)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 14:17:45 PST 2024


================
@@ -5218,15 +5218,15 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
         // Note: type promotion is intended to be handeled via the intrinsics
         //  and not the builtin itself.
         S->Diag(TheCall->getBeginLoc(),
-                diag::err_vec_builtin_incompatible_vector_all)
-            << TheCall->getDirectCallee()
+                diag::err_vec_builtin_incompatible_vector)
+            << TheCall->getDirectCallee() << /*all args*/ true
             << SourceRange(A.get()->getBeginLoc(), B.get()->getEndLoc());
         retValue = true;
       }
       if (VecTyA->getNumElements() != VecTyB->getNumElements()) {
         // if we get here a HLSLVectorTruncation is needed.
----------------
farzonl wrote:

I've adapted this comment to: 
```cpp
// You should only be hitting this case if you are calling the builtin
// directly. HLSL intrinsics should avoid this case via a
// HLSLVectorTruncation.
```

https://github.com/llvm/llvm-project/pull/83609


More information about the cfe-commits mailing list