How to create a 64 bit ConstInt having a value of -1?

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

Your APInt constructor arguments are reversed. Bit width comes first. The value.

Thanks Craig. Too dumb of me.