[llvm-dev] Printing out a 128 bit decimal

Tim Northover via llvm-dev
Fri, 26 May 2017 14:01:25 -0000

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.