@@ -16749,7 +16749,7 @@ static bool checkMathBuiltinElementType(Sema &S, SourceLocation Loc,
16749
16749
QualType Ty) {
16750
16750
if (!Ty->getAs<VectorType>() && !ConstantMatrixType::isValidElementType(Ty)) {
16751
16751
S.Diag(Loc, diag::err_builtin_invalid_arg_type)
16752
- << 1 << " vector, integer or floating point type" << Ty;
16752
+ << 1 << /* vector, integer or float ty*/ 0 << Ty;
16753
16753
return true;
16754
16754
}
16755
16755
return false;
@@ -16797,7 +16797,8 @@ ExprResult Sema::SemaBuiltinMatrixTranspose(CallExpr *TheCall,
16797
16797
16798
16798
auto *MType = Matrix->getType()->getAs<ConstantMatrixType>();
16799
16799
if (!MType) {
16800
- Diag(Matrix->getBeginLoc(), diag::err_builtin_matrix_arg);
16800
+ Diag(Matrix->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16801
+ << 1 << /* matrix ty*/ 1 << Matrix->getType();
16801
16802
return ExprError();
16802
16803
}
16803
16804
@@ -16868,15 +16869,16 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
16868
16869
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
16869
16870
QualType ElementTy;
16870
16871
if (!PtrTy) {
16871
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg )
16872
- << PtrArgIdx + 1;
16872
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type )
16873
+ << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType() ;
16873
16874
ArgError = true;
16874
16875
} else {
16875
16876
ElementTy = PtrTy->getPointeeType().getUnqualifiedType();
16876
16877
16877
16878
if (!ConstantMatrixType::isValidElementType(ElementTy)) {
16878
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
16879
- << PtrArgIdx + 1;
16879
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16880
+ << PtrArgIdx + 1 << /* pointer to element ty*/ 2
16881
+ << PtrExpr->getType();
16880
16882
ArgError = true;
16881
16883
}
16882
16884
}
@@ -16975,7 +16977,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
16975
16977
16976
16978
auto *MatrixTy = MatrixExpr->getType()->getAs<ConstantMatrixType>();
16977
16979
if (!MatrixTy) {
16978
- Diag(MatrixExpr->getBeginLoc(), diag::err_builtin_matrix_arg) << 0;
16980
+ Diag(MatrixExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type)
16981
+ << 1 << /*matrix ty */ 1 << MatrixExpr->getType();
16979
16982
ArgError = true;
16980
16983
}
16981
16984
@@ -16994,8 +16997,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
16994
16997
// Check pointer argument.
16995
16998
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
16996
16999
if (!PtrTy) {
16997
- Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg )
16998
- << PtrArgIdx + 1;
17000
+ Diag(PtrExpr->getBeginLoc(), diag::err_builtin_invalid_arg_type )
17001
+ << PtrArgIdx + 1 << /*pointer to element ty*/ 2 << PtrExpr->getType() ;
16999
17002
ArgError = true;
17000
17003
} else {
17001
17004
QualType ElementTy = PtrTy->getPointeeType();
0 commit comments