Author: Simon Pilgrim Date: 2021-06-09T11:09:31+01:00 New Revision: d806d11b14e1db7d5c5986d563e74ca972f0e5e6
URL: https://github.com/llvm/llvm-project/commit/d806d11b14e1db7d5c5986d563e74ca972f0e5e6 DIFF: https://github.com/llvm/llvm-project/commit/d806d11b14e1db7d5c5986d563e74ca972f0e5e6.diff LOG: Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI Pulled out of D103888 - use the underlying SmallString version directly Added: Modified: clang/lib/AST/Interp/Interp.h Removed: ################################################################################ diff --git a/clang/lib/AST/Interp/Interp.h b/clang/lib/AST/Interp/Interp.h index a63c5a871ba33..e2f7bf0dc26a4 100644 --- a/clang/lib/AST/Interp/Interp.h +++ b/clang/lib/AST/Interp/Interp.h @@ -118,7 +118,8 @@ bool AddSubMulHelper(InterpState &S, CodePtr OpPC, unsigned Bits, const T &LHS, const Expr *E = S.Current->getExpr(OpPC); QualType Type = E->getType(); if (S.checkingForUndefinedBehavior()) { - auto Trunc = Value.trunc(Result.bitWidth()).toString(10); + SmallString<32> Trunc; + Value.trunc(Result.bitWidth()).toString(Trunc, 10); auto Loc = E->getExprLoc(); S.report(Loc, diag::warn_integer_constant_overflow) << Trunc << Type; return true; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits