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

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 19 18:35:19 PDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171020/b484c639/attachment.html>


More information about the llvm-dev mailing list