Geting the size of a structure?

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


Evan Jones

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

Ah! Very clever! Of course, you cast null to an array, then get a
pointer to the first element! I never would have thought of that.

Thanks for helping me out,

Evan Jones