projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
905f4eb
)
Interp.h - AddSubMulHelper - avoid APSInt::toString std::string wrapper. NFCI
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 9 Jun 2021 10:06:23 +0000
(11:06 +0100)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 9 Jun 2021 10:09:31 +0000
(11:09 +0100)
Pulled out of D103888 - use the underlying SmallString version directly
clang/lib/AST/Interp/Interp.h
patch
|
blob
|
history
diff --git
a/clang/lib/AST/Interp/Interp.h
b/clang/lib/AST/Interp/Interp.h
index
a63c5a8
..
e2f7bf0
100644
(file)
--- 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;