[llvm-dev] How to create a 64 bit ConstInt having a value of -1?

Dipanjan Das via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 19 21:16:08 PDT 2017


Thanks Craig. Too dumb of me.

On 19 October 2017 at 18:35, Craig Topper <craig.topper at gmail.com> wrote:

> Your APInt constructor arguments are reversed. Bit width comes first. The
> value.
>
> On Thu, Oct 19, 2017 at 5:27 PM Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> I tried the following:
>>
>>  - ConstantInt::get(Type::getInt64Ty(Ctx), APInt(0xFFFFFFFFFFFFFFFF, 64,
>> false))
>>  - ConstantInt::get(Type::getInt64Ty(Ctx), APInt(-1, 64))
>>
>> I am receiving the following error: Assertion `NumBits <= MAX_INT_BITS &&
>> "bitwidth too large" failed
>>
>> --
>>
>> Thanks & Regards,
>> Dipanjan
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
> --
> ~Craig
>



-- 

Thanks & Regards,
Dipanjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171019/89ec81b6/attachment.html>


More information about the llvm-dev mailing list