[llvm-commits] [PATCH] Handle negative values in StringRef::getAsInteger(unsigned Radix, APInt &).

Michael Spencer bigcheesegs at gmail.com
Thu Feb 16 14:45:07 PST 2012


On Thu, Feb 16, 2012 at 8:20 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Feb 15, 2012, at 4:25 PM, Michael Spencer wrote:
>
>> I have a use case for this in lld.
>
>
> This is sorta strange to me, how about adding an APSInt overload that allows negative (also weird) or a new getAsSignedInteger method (probably better)?
>
> -Chris

There is already precedent in the other StringRef::getAsInteger
functions to accept negative values. I believe the interface should be
uniform.

All I actually need is uint64_t and int64_t, however, these are
unsigned long and long on my platform (x86-64 Linux), and thus don't
match any of the overloads.

Would it be better for me to just cleanup the overload set?

- Michael Spencer



More information about the llvm-commits mailing list