@@ -16530,7 +16530,7 @@ static bool checkMathBuiltinElementType(Sema &S, SourceLocation Loc,
16530
16530
QualType Ty) {
16531
16531
if (!Ty->getAs<VectorType>() && !ConstantMatrixType::isValidElementType(Ty)) {
16532
16532
S.Diag(Loc, diag::err_builtin_invalid_arg_type)
16533
- << 1 << " vector, integer or floating point type" << Ty;
16533
+ << 1 << /* vector, integer or float ty*/ 0 << Ty;
16534
16534
return true;
16535
16535
}
16536
16536
return false;
@@ -16578,7 +16578,8 @@ ExprResult Sema::SemaBuiltinMatrixTranspose(CallExpr *TheCall,
16578
16578
16579
16579
auto *MType = Matrix->getType()->getAs<ConstantMatrixType>();
16580
16580
if (!MType) {
16581
- Diag(Matrix->getBeginLoc(), diag::err_builtin_matrix_arg);
16581
+ Diag(Matrix->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16582
+ << 1 << /* matrix ty*/ 1 << Matrix->getType();
16582
16583
return ExprError();
16583
16584
}
16584
16585
@@ -16649,15 +16650,16 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
16649
16650
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
16650
16651
QualType ElementTy;
16651
16652
if (!PtrTy) {
16652
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg )
16653
- << PtrArgIdx + 1;
16653
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type )
16654
+ << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType() ;
16654
16655
ArgError = true;
16655
16656
} else {
16656
16657
ElementTy = PtrTy->getPointeeType().getUnqualifiedType();
16657
16658
16658
16659
if (!ConstantMatrixType::isValidElementType(ElementTy)) {
16659
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
16660
- << PtrArgIdx + 1;
16660
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16661
+ << PtrArgIdx + 1 << /* pointer to element ty*/ 2
16662
+ << PtrExpr->getType();
16661
16663
ArgError = true;
16662
16664
}
16663
16665
}
@@ -16756,7 +16758,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
16756
16758
16757
16759
auto *MatrixTy = MatrixExpr->getType()->getAs<ConstantMatrixType>();
16758
16760
if (!MatrixTy) {
16759
- Diag(MatrixExpr->getBeginLoc(), diag::err_builtin_matrix_arg) << 0;
16761
+ Diag(MatrixExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16762
+ << 1 << /*matrix ty */ 1 << MatrixExpr->getType();
16760
16763
ArgError = true;
16761
16764
}
16762
16765
@@ -16775,8 +16778,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
16775
16778
// Check pointer argument.
16776
16779
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
16777
16780
if (!PtrTy) {
16778
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg )
16779
- << PtrArgIdx + 1;
16781
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type )
16782
+ << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType() ;
16780
16783
ArgError = true;
16781
16784
} else {
16782
16785
QualType ElementTy = PtrTy->getPointeeType();
0 commit comments