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

Michael Spencer bigcheesegs at gmail.com
Tue Feb 21 11:17:16 PST 2012


On Thu, Feb 16, 2012 at 2:45 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> 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

Ping.

- Michael Spencer



More information about the llvm-commits mailing list