[clang] dd45c06 - [clang][NFC] Fix BuildExtVectorType parameter name (#166208)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 3 11:54:06 PST 2025
Author: Amr Hesham
Date: 2025-11-03T20:54:02+01:00
New Revision: dd45c060ffe05eca991b8ed01a71d09edeebbc94
URL: https://github.com/llvm/llvm-project/commit/dd45c060ffe05eca991b8ed01a71d09edeebbc94
DIFF: https://github.com/llvm/llvm-project/commit/dd45c060ffe05eca991b8ed01a71d09edeebbc94.diff
LOG: [clang][NFC] Fix BuildExtVectorType parameter name (#166208)
Fix the parameter name in the BuildExtVectorType function, also updating
the code style to be consistent with BuildVectorType
Discovered in #166055
Added:
Modified:
clang/lib/Sema/SemaType.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 682fd258eccf2..c483930705057 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -2399,7 +2399,7 @@ QualType Sema::BuildVectorType(QualType CurType, Expr *SizeExpr,
VectorKind::Generic);
}
-QualType Sema::BuildExtVectorType(QualType T, Expr *ArraySize,
+QualType Sema::BuildExtVectorType(QualType T, Expr *SizeExpr,
SourceLocation AttrLoc) {
// Unlike gcc's vector_size attribute, we do not allow vectors to be defined
// in conjunction with complex types (pointers, arrays, functions, etc.).
@@ -2422,40 +2422,40 @@ QualType Sema::BuildExtVectorType(QualType T, Expr *ArraySize,
BIT && CheckBitIntElementType(*this, AttrLoc, BIT))
return QualType();
- if (!ArraySize->isTypeDependent() && !ArraySize->isValueDependent()) {
- std::optional<llvm::APSInt> vecSize =
- ArraySize->getIntegerConstantExpr(Context);
- if (!vecSize) {
+ if (!SizeExpr->isTypeDependent() && !SizeExpr->isValueDependent()) {
+ std::optional<llvm::APSInt> VecSize =
+ SizeExpr->getIntegerConstantExpr(Context);
+ if (!VecSize) {
Diag(AttrLoc, diag::err_attribute_argument_type)
- << "ext_vector_type" << AANT_ArgumentIntegerConstant
- << ArraySize->getSourceRange();
+ << "ext_vector_type" << AANT_ArgumentIntegerConstant
+ << SizeExpr->getSourceRange();
return QualType();
}
- if (vecSize->isNegative()) {
- Diag(ArraySize->getExprLoc(), diag::err_attribute_vec_negative_size);
+ if (VecSize->isNegative()) {
+ Diag(SizeExpr->getExprLoc(), diag::err_attribute_vec_negative_size);
return QualType();
}
- if (!vecSize->isIntN(32)) {
+ if (!VecSize->isIntN(32)) {
Diag(AttrLoc, diag::err_attribute_size_too_large)
- << ArraySize->getSourceRange() << "vector";
+ << SizeExpr->getSourceRange() << "vector";
return QualType();
}
// Unlike gcc's vector_size attribute, the size is specified as the
// number of elements, not the number of bytes.
- unsigned vectorSize = static_cast<unsigned>(vecSize->getZExtValue());
+ unsigned VectorSize = static_cast<unsigned>(VecSize->getZExtValue());
- if (vectorSize == 0) {
+ if (VectorSize == 0) {
Diag(AttrLoc, diag::err_attribute_zero_size)
- << ArraySize->getSourceRange() << "vector";
+ << SizeExpr->getSourceRange() << "vector";
return QualType();
}
- return Context.getExtVectorType(T, vectorSize);
+ return Context.getExtVectorType(T, VectorSize);
}
- return Context.getDependentSizedExtVectorType(T, ArraySize, AttrLoc);
+ return Context.getDependentSizedExtVectorType(T, SizeExpr, AttrLoc);
}
QualType Sema::BuildMatrixType(QualType ElementTy, Expr *NumRows, Expr *NumCols,
More information about the cfe-commits
mailing list