Skip to content

Commit 92e4007

Browse files
committed
Apply feedback
1 parent 13c9d31 commit 92e4007

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,15 +2985,15 @@ static bool interp__builtin_ia32_phminposuw(InterpState &S, CodePtr OpPC,
29852985
unsigned SourceLen = Source.getNumElems();
29862986
QualType ElemQT = getElemType(Source);
29872987
OptPrimType ElemT = S.getContext().classify(ElemQT);
2988-
unsigned LaneBitWidth = S.getASTContext().getTypeSize(ElemQT);
2988+
unsigned ElemBitWidth = S.getASTContext().getTypeSize(ElemQT);
29892989

29902990
bool DestUnsigned = Call->getCallReturnType(S.getASTContext())
29912991
->castAs<VectorType>()
29922992
->getElementType()
29932993
->isUnsignedIntegerOrEnumerationType();
29942994

29952995
INT_TYPE_SWITCH_NO_BOOL(*ElemT, {
2996-
APSInt MinIndex(LaneBitWidth, DestUnsigned);
2996+
APSInt MinIndex(ElemBitWidth, DestUnsigned);
29972997
APSInt MinVal = Source.elem<T>(0).toAPSInt();
29982998

29992999
for (unsigned I = 1; I != SourceLen; ++I) {
@@ -3007,7 +3007,7 @@ static bool interp__builtin_ia32_phminposuw(InterpState &S, CodePtr OpPC,
30073007
Dest.elem<T>(0) = static_cast<T>(MinVal);
30083008
Dest.elem<T>(1) = static_cast<T>(MinIndex);
30093009
for (unsigned I = 2; I != SourceLen; ++I) {
3010-
Dest.elem<T>(I) = static_cast<T>(APSInt(LaneBitWidth, DestUnsigned));
3010+
Dest.elem<T>(I) = static_cast<T>(APSInt(ElemBitWidth, DestUnsigned));
30113011
}
30123012
});
30133013
Dest.initializeAllElements();

clang/lib/AST/ExprConstant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12275,9 +12275,9 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1227512275
unsigned SourceLen = Source.getVectorLength();
1227612276
const VectorType *VT = E->getArg(0)->getType()->castAs<VectorType>();
1227712277
QualType ElemQT = VT->getElementType();
12278-
unsigned LaneBitWidth = Info.Ctx.getTypeSize(ElemQT);
12278+
unsigned ElemBitWidth = Info.Ctx.getTypeSize(ElemQT);
1227912279

12280-
APInt MinIndex(LaneBitWidth, 0);
12280+
APInt MinIndex(ElemBitWidth, 0);
1228112281
APInt MinVal = Source.getVectorElt(0).getInt();
1228212282
for (unsigned I = 0; I != SourceLen; ++I) {
1228312283
APInt Val = Source.getVectorElt(I).getInt();
@@ -12297,7 +12297,7 @@ bool VectorExprEvaluator::VisitCallExpr(const CallExpr *E) {
1229712297
Result.emplace_back(APSInt(MinVal, ResultUnsigned));
1229812298
Result.emplace_back(APSInt(MinIndex, ResultUnsigned));
1229912299
for (unsigned I = 0; I != SourceLen - 2; ++I) {
12300-
Result.emplace_back(APSInt(APInt(LaneBitWidth, 0), ResultUnsigned));
12300+
Result.emplace_back(APSInt(APInt(ElemBitWidth, 0), ResultUnsigned));
1230112301
}
1230212302
return Success(APValue(Result.data(), Result.size()), E);
1230312303
}

0 commit comments

Comments
 (0)