[LLVMdev] Matching struct layouts.

Óscar Fuentes ofv at wanadoo.es
Fri May 16 05:08:08 PDT 2008


Duncan Sands <baldrick at free.fr> writes:

>> > 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".
>
> That's not entirely true.  For example it assumes the user is not
> using attributes to create types with unusual alignments or sizes.

Using attributes means bypassing the platform C ABI and introducing a
compiler-specific ABI, right?

My point is that if your code does not depend on a specific compiler
extensions, llvm-gcc shouldn't behave different wrt data layout.

[snip]

-- 
Oscar



More information about the llvm-dev mailing list