Skip to content

Commit dd45c06

Browse files
authored
[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
1 parent ca69a8d commit dd45c06

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

clang/lib/Sema/SemaType.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ QualType Sema::BuildVectorType(QualType CurType, Expr *SizeExpr,
23992399
VectorKind::Generic);
24002400
}
24012401

2402-
QualType Sema::BuildExtVectorType(QualType T, Expr *ArraySize,
2402+
QualType Sema::BuildExtVectorType(QualType T, Expr *SizeExpr,
24032403
SourceLocation AttrLoc) {
24042404
// Unlike gcc's vector_size attribute, we do not allow vectors to be defined
24052405
// in conjunction with complex types (pointers, arrays, functions, etc.).
@@ -2422,40 +2422,40 @@ QualType Sema::BuildExtVectorType(QualType T, Expr *ArraySize,
24222422
BIT && CheckBitIntElementType(*this, AttrLoc, BIT))
24232423
return QualType();
24242424

2425-
if (!ArraySize->isTypeDependent() && !ArraySize->isValueDependent()) {
2426-
std::optional<llvm::APSInt> vecSize =
2427-
ArraySize->getIntegerConstantExpr(Context);
2428-
if (!vecSize) {
2425+
if (!SizeExpr->isTypeDependent() && !SizeExpr->isValueDependent()) {
2426+
std::optional<llvm::APSInt> VecSize =
2427+
SizeExpr->getIntegerConstantExpr(Context);
2428+
if (!VecSize) {
24292429
Diag(AttrLoc, diag::err_attribute_argument_type)
2430-
<< "ext_vector_type" << AANT_ArgumentIntegerConstant
2431-
<< ArraySize->getSourceRange();
2430+
<< "ext_vector_type" << AANT_ArgumentIntegerConstant
2431+
<< SizeExpr->getSourceRange();
24322432
return QualType();
24332433
}
24342434

2435-
if (vecSize->isNegative()) {
2436-
Diag(ArraySize->getExprLoc(), diag::err_attribute_vec_negative_size);
2435+
if (VecSize->isNegative()) {
2436+
Diag(SizeExpr->getExprLoc(), diag::err_attribute_vec_negative_size);
24372437
return QualType();
24382438
}
24392439

2440-
if (!vecSize->isIntN(32)) {
2440+
if (!VecSize->isIntN(32)) {
24412441
Diag(AttrLoc, diag::err_attribute_size_too_large)
2442-
<< ArraySize->getSourceRange() << "vector";
2442+
<< SizeExpr->getSourceRange() << "vector";
24432443
return QualType();
24442444
}
24452445
// Unlike gcc's vector_size attribute, the size is specified as the
24462446
// number of elements, not the number of bytes.
2447-
unsigned vectorSize = static_cast<unsigned>(vecSize->getZExtValue());
2447+
unsigned VectorSize = static_cast<unsigned>(VecSize->getZExtValue());
24482448

2449-
if (vectorSize == 0) {
2449+
if (VectorSize == 0) {
24502450
Diag(AttrLoc, diag::err_attribute_zero_size)
2451-
<< ArraySize->getSourceRange() << "vector";
2451+
<< SizeExpr->getSourceRange() << "vector";
24522452
return QualType();
24532453
}
24542454

2455-
return Context.getExtVectorType(T, vectorSize);
2455+
return Context.getExtVectorType(T, VectorSize);
24562456
}
24572457

2458-
return Context.getDependentSizedExtVectorType(T, ArraySize, AttrLoc);
2458+
return Context.getDependentSizedExtVectorType(T, SizeExpr, AttrLoc);
24592459
}
24602460

24612461
QualType Sema::BuildMatrixType(QualType ElementTy, Expr *NumRows, Expr *NumCols,

0 commit comments

Comments
 (0)