Skip to content

Commit d806d11

Browse files
committed
Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI
Pulled out of D103888 - use the underlying SmallString version directly
1 parent 905f4eb commit d806d11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/AST/Interp/Interp.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS,
118118
const Expr *E = S.Current->getExpr(OpPC);
119119
QualType Type = E->getType();
120120
if (S.checkingForUndefinedBehavior()) {
121-
auto Trunc = Value.trunc(Result.bitWidth()).toString(10);
121+
SmallString<32> Trunc;
122+
Value.trunc(Result.bitWidth()).toString(Trunc, 10);
122123
auto Loc = E->getExprLoc();
123124
S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type;
124125
return true;

0 commit comments

Comments
 (0)