diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-06-14 13:03:34 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-06-14 15:13:56 +0200 |
commit | 900506c9060415ab890a9169c4cb7997d0ba8217 (patch) | |
tree | 8ffb8cefc3e4ca6c626c1bd49299a6b2b33bba40 /compilerplugins/clang/singlevalfields.cxx | |
parent | 2bc78bb5b49c9bb78e65c33c905029b22f29de82 (diff) |
Adapt compilerplugins to LLVM 13 APSInt::toString change
<https://github.com/llvm/llvm-project/commit/61cdaf66fe22be2b5942ddee4f46a998b4f3ee29>
"[ADT] Remove APInt/APSInt toString() std::string variants".
TODO: While most uses of compat::toString should be harmless performance-wise,
as they are either in error reporting code or in plugins that are not run by
default, some calls like the one in compilerplugins/clang/staticconstfield.cxx
might benefit from moving them away from using std::string.
Change-Id: Icfac7d6d4a0a4a4edeb5c8bdcdbc13b73e20a5e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117152
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/singlevalfields.cxx')
-rw-r--r-- | compilerplugins/clang/singlevalfields.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compilerplugins/clang/singlevalfields.cxx b/compilerplugins/clang/singlevalfields.cxx index 2731f55c8587..228e7ddcb211 100644 --- a/compilerplugins/clang/singlevalfields.cxx +++ b/compilerplugins/clang/singlevalfields.cxx @@ -15,6 +15,7 @@ #include "config_clang.h" +#include "compat.hxx" #include "plugin.hxx" #if CLANG_VERSION >= 110000 @@ -574,7 +575,7 @@ std::string SingleValFields::getExprValue(const Expr* arg) } APSInt x1; if (compat::EvaluateAsInt(arg, x1, compiler.getASTContext())) - return x1.toString(10); + return compat::toString(x1, 10); if (isa<CXXNullPtrLiteralExpr>(arg)) return "0"; return "?"; |