Is sizeof(pointer) known in LLVM IR?

If you look at some LLVM assembly (e.g. emitted by clang -emit-llvm -S
your_program.c) you'll see "target datalayout..." at the top. The
information on the size of the pointer and its alignment are there.
AFAIK this information is present in all LLVM modules and so is
present very early on.

Take a look at [1] and pay special attention to the bit starting

The LLVM C++ API for llvm::Module seems to have what you want [2] so I
see no reason why you could not have access to this in one of your


Hope that helps,

Dan Liew.