Alberto Barbaro via llvm-dev
2022-Jan-06 15:44 UTC
[llvm-dev] How to convert an APSInt to string in llvm-13?
Hello, until llvm-12 i could convert an APSInt to string just using toString() but now in llvm-13 I think I'm supposed to use a different version of toString(). I tried multiple times but nothing so far. Could you help me to "convert" this line os << '[' << i->From().toString(10) << ", " << i->To().toString(10) << ']';? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20220106/67c11239/attachment.html>
Simon Pilgrim via llvm-dev
2022-Jan-06 16:13 UTC
[llvm-dev] How to convert an APSInt to string in llvm-13?
We made this change in https://reviews.llvm.org/D103888 which has examples of the refactor necessary. You should be able to use the llvm::toString(const APSInt &I, unsigned Radix) helper found in StringExtras.h But if you're always wanting Radix = 10, you might be able to just stream the APSInt directly: os << '[' << i->From() << ", " << i->To() << ']'; Simon. On 06/01/2022 15:44, Alberto Barbaro via llvm-dev wrote:> Hello, > until llvm-12 i could convert an APSInt to string just using > toString() but now in llvm-13 I think I'm supposed to use a different > version of toString(). I tried multiple times but nothing so far. > > Could you help me to "convert" this line os << '[' << > i->From().toString(10) << ", " << i->To().toString(10) << ']';? > > Thanks > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev