[LLVMdev] Sizeof a type?

Rick Mann rmann at latencyzero.com
Sun Jan 20 04:04:10 PST 2013

On Jan 20, 2013, at 3:21 , Duncan Sands <baldrick at free.fr> wrote:

> if you have DataLayout available, use the getTypeAllocSize method.  If you don't
> have information about the target then you can use ConstantExpr::getSizeOf.  The
> advantage of DataLayout is that it returns a number (eg: 8) while getSizeOf
> returns a mysterious expression (the optimizers will simplify it to a number,
> the same as getTypeAllocSize returns, if you provide them with DataLayout).

Thanks, Duncan. What's the difference between DataLayout::getTypeAllocSize and DataLayout::getTypeStoreSize?


More information about the llvm-dev mailing list