@@ -5218,15 +5218,17 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
5218
5218
// Note: type promotion is intended to be handeled via the intrinsics
5219
5219
// and not the builtin itself.
5220
5220
S->Diag(TheCall->getBeginLoc(),
5221
- diag::err_vec_builtin_incompatible_vector_all )
5222
- << TheCall->getDirectCallee()
5221
+ diag::err_vec_builtin_incompatible_vector )
5222
+ << TheCall->getDirectCallee() << /*useAllTerminology*/ true
5223
5223
<< SourceRange(A.get()->getBeginLoc(), B.get()->getEndLoc());
5224
5224
retValue = true;
5225
5225
}
5226
5226
if (VecTyA->getNumElements() != VecTyB->getNumElements()) {
5227
- // if we get here a HLSLVectorTruncation is needed.
5228
- S->Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector_all)
5229
- << TheCall->getDirectCallee()
5227
+ // You should only be hitting this case if you are calling the builtin
5228
+ // directly. HLSL intrinsics should avoid this case via a
5229
+ // HLSLVectorTruncation.
5230
+ S->Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
5231
+ << TheCall->getDirectCallee() << /*useAllTerminology*/ true
5230
5232
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
5231
5233
TheCall->getArg(1)->getEndLoc());
5232
5234
retValue = true;
@@ -5241,8 +5243,8 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr *TheCall) {
5241
5243
5242
5244
// Note: if we get here one of the args is a scalar which
5243
5245
// requires a VectorSplat on Arg0 or Arg1
5244
- S->Diag(BuiltinLoc, diag::err_vec_builtin_non_vector_all )
5245
- << TheCall->getDirectCallee()
5246
+ S->Diag(BuiltinLoc, diag::err_vec_builtin_non_vector )
5247
+ << TheCall->getDirectCallee() << /*useAllTerminology*/ true
5246
5248
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
5247
5249
TheCall->getArg(1)->getEndLoc());
5248
5250
return true;
@@ -9472,15 +9474,15 @@ bool Sema::SemaBuiltinVSX(CallExpr *TheCall) {
9472
9474
if ((!Arg1Ty->isVectorType() && !Arg1Ty->isDependentType()) ||
9473
9475
(!Arg2Ty->isVectorType() && !Arg2Ty->isDependentType())) {
9474
9476
return Diag(BuiltinLoc, diag::err_vec_builtin_non_vector)
9475
- << TheCall->getDirectCallee()
9477
+ << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
9476
9478
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
9477
9479
TheCall->getArg(1)->getEndLoc());
9478
9480
}
9479
9481
9480
9482
// Check the first two arguments are the same type.
9481
9483
if (!Context.hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
9482
9484
return Diag(BuiltinLoc, diag::err_vec_builtin_incompatible_vector)
9483
- << TheCall->getDirectCallee()
9485
+ << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
9484
9486
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
9485
9487
TheCall->getArg(1)->getEndLoc());
9486
9488
}
@@ -9516,7 +9518,7 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
9516
9518
if (!LHSType->isVectorType() || !RHSType->isVectorType())
9517
9519
return ExprError(
9518
9520
Diag(TheCall->getBeginLoc(), diag::err_vec_builtin_non_vector)
9519
- << TheCall->getDirectCallee()
9521
+ << TheCall->getDirectCallee() << /*isMorethantwoArgs*/ false
9520
9522
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
9521
9523
TheCall->getArg(1)->getEndLoc()));
9522
9524
@@ -9532,12 +9534,14 @@ ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) {
9532
9534
return ExprError(Diag(TheCall->getBeginLoc(),
9533
9535
diag::err_vec_builtin_incompatible_vector)
9534
9536
<< TheCall->getDirectCallee()
9537
+ << /*isMorethantwoArgs*/ false
9535
9538
<< SourceRange(TheCall->getArg(1)->getBeginLoc(),
9536
9539
TheCall->getArg(1)->getEndLoc()));
9537
9540
} else if (!Context.hasSameUnqualifiedType(LHSType, RHSType)) {
9538
9541
return ExprError(Diag(TheCall->getBeginLoc(),
9539
9542
diag::err_vec_builtin_incompatible_vector)
9540
9543
<< TheCall->getDirectCallee()
9544
+ << /*isMorethantwoArgs*/ false
9541
9545
<< SourceRange(TheCall->getArg(0)->getBeginLoc(),
9542
9546
TheCall->getArg(1)->getEndLoc()));
9543
9547
} else if (numElements != numResElements) {
0 commit comments