[LLVMdev] Union type, is it really used or necessary?

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Sep 8 04:36:53 PDT 2010


On 08 Sep 2010, at 13:03, David Given wrote:

> On 07/09/10 14:22, Erik de Castro Lopo wrote:
> [...]
>> When generating 32 bit code the struct looks like:
>>
>>     <{ i32, pointer }>
>>
>> and for 64 bit code:
>>
>>     <{ union { i32, i64 }, pointer }>
>
> Surely LLVM will cause the first structure to be correctly aligned on
> 64-bit platforms by automatically inserting padding?

No, because it is declared as "packed" (the angle brackets).


Jonas




More information about the llvm-dev mailing list