[llvm-dev] Printing out a 128 bit decimal

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri May 26 07:01:25 PDT 2017


On 26 May 2017 at 03:09, Jajoo, Malhar via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> "ConstantInt::getSextValue() " but the return value is only a int64_t.

getValue returns an APInt (LLVM's arbitrary-precision int type), which
has its own print method. So something like:

    Imm->getValue()->print(errs());

> I wish to print it on the console output and printing as a string or decimal
> ( using C standard library printf )

I don't think printf supports 128-bit types. They're non-standard in C and C++

Cheers.

Tim.


More information about the llvm-dev mailing list