[LLVMdev] Matching struct layouts.

Óscar Fuentes ofv at wanadoo.es
Fri May 16 04:06:04 PDT 2008


"Mahadevan R" <mdevan.foobar at gmail.com> writes:

>> You could use llvm-gcc to convert the struct to an LLVM type.
>> Otherwise, it wouldn't be too hard to convert the struct by
>> hand as long as it doesn't have any exotic types in it.  A
>> VLA at the end (with element type T) is currently represented
>> by placing a field of type T at the end (i.e. just one element).
>
> But can I assume that both gcc and LLVM will layout the structure
> in the same way (member alignment, padding)?

llvm-gcc and gcc follows the same platform C ABI. So the answer to your
question is "yes".

-- 
Oscar



More information about the llvm-dev mailing list