aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-06-25 11:48:07 +0100
committerFlorian Hahn <flo@fhahn.com>2020-06-25 11:55:03 +0100
commit043b608399559969f563eaa52e11a7ffe37137d9 (patch)
tree5d9aecd9466985c069307e33f45467966ee24b24 /clang/lib/Sema/SemaChecking.cpp
parent187f627a5057e55e140b2cf8237c69deb87c0193 (diff)
downloadllvm-043b608399559969f563eaa52e11a7ffe37137d9.zip
llvm-043b608399559969f563eaa52e11a7ffe37137d9.tar.gz
llvm-043b608399559969f563eaa52e11a7ffe37137d9.tar.bz2
[Matrix] Use 1st/2nd instead of first/second in matrix diags.
This was suggested in D72782 and brings the diagnostics more in line with how argument references are handled elsewhere. Reviewers: rjmccall, jfb, Bigcheese Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D82473
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index e6a3b54..9d0516e 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -15295,7 +15295,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
if (checkArgCount(*this, TheCall, 4))
return ExprError();
- Expr *PtrExpr = TheCall->getArg(0);
+ unsigned PtrArgIdx = 0;
+ Expr *PtrExpr = TheCall->getArg(PtrArgIdx);
Expr *RowsExpr = TheCall->getArg(1);
Expr *ColumnsExpr = TheCall->getArg(2);
Expr *StrideExpr = TheCall->getArg(3);
@@ -15319,14 +15320,14 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
QualType ElementTy;
if (!PtrTy) {
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
- << "first";
+ << PtrArgIdx + 1;
ArgError = true;
} else {
ElementTy = PtrTy->getPointeeType().getUnqualifiedType();
if (!ConstantMatrixType::isValidElementType(ElementTy)) {
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
- << "first";
+ << PtrArgIdx + 1;
ArgError = true;
}
}
@@ -15402,8 +15403,9 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
if (checkArgCount(*this, TheCall, 3))
return ExprError();
+ unsigned PtrArgIdx = 1;
Expr *MatrixExpr = TheCall->getArg(0);
- Expr *PtrExpr = TheCall->getArg(1);
+ Expr *PtrExpr = TheCall->getArg(PtrArgIdx);
Expr *StrideExpr = TheCall->getArg(2);
bool ArgError = false;
@@ -15442,7 +15444,7 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
if (!PtrTy) {
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
- << "second";
+ << PtrArgIdx + 1;
ArgError = true;
} else {
QualType ElementTy = PtrTy->getPointeeType();