From: Khem Raj Date: Mon, 14 Jun 2021 19:49:43 +0000 (-0700) Subject: Remove APInt/APSInt toString() std::string variants X-Git-Tag: v0.21.0~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e6c05daa935b200b5f55d6c02c0255795f1b5ca;p=platform%2Fupstream%2Fbcc.git Remove APInt/APSInt toString() std::string variants clang 13+ has removed this in favour of a pair of llvm::toString () helpers inside StringExtras.h to improve compile speed by avoiding hits on header Signed-off-by: Khem Raj --- diff --git a/src/cc/json_map_decl_visitor.cc b/src/cc/json_map_decl_visitor.cc index eff4d067..53896199 100644 --- a/src/cc/json_map_decl_visitor.cc +++ b/src/cc/json_map_decl_visitor.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include "common.h" #include "table_desc.h" @@ -79,7 +80,11 @@ void BMapDeclVisitor::genJSONForField(FieldDecl *F) { result_ += "["; TraverseDecl(F); if (const ConstantArrayType *T = dyn_cast(F->getType())) +#if LLVM_MAJOR_VERSION >= 13 + result_ += ", [" + toString(T->getSize(), 10, false) + "]"; +#else result_ += ", [" + T->getSize().toString(10, false) + "]"; +#endif if (F->isBitField()) result_ += ", " + to_string(F->getBitWidthValue(C)); result_ += "], ";