[LLVMdev] Geting the size of a structure?

Alkis Evlogimenos evlogimenos at gmail.com
Thu Apr 21 15:00:45 PDT 2005


On Thu, 2005-04-21 at 17:56 -0400, Evan Jones wrote:
> How does LLVM-GCC emit the correct size for structures? Is structure
> packing part of the  "platform specific" magic that GCC knows, or is
> there some "portable" way to put a structure size into LLVM byte code?
> 
> Actually, I don't care if it is portable, as long as LLVM has some way
> to compute it for me, and I don't have to know about the underlying
> platform.

You may want to look at ConstantExpr::getSizeOf(const Type*)

-- 

Alkis




More information about the llvm-dev mailing list