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. Thanks, Evan Jones
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
On Thu, 2005-21-04 at 17:00 -0500, Alkis Evlogimenos wrote:> 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