[llvm-dev] How to convert an APSInt to string in llvm-13?

Alberto Barbaro via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 6 09:59:57 PST 2022


Thanks Simon,
That's solved the problem.

Thanks

On Thu, Jan 6, 2022, 16:13 Simon Pilgrim via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20220106/8f94e615/attachment.html>


More information about the llvm-dev mailing list