[LLVMdev] Structure Types and ABI sizes

Jochen Wilhelmy j.wilhelmy at arcor.de
Fri Mar 4 04:51:07 PST 2011


>> %I = type { i32, i8 }; // 5 bytes
>> %I' = type { %I, tailpad}; // 8 bytes
>> %J = type { %I, i8 } // 6 bytes
>>      
> That would break C code (and whatever else relies on alignment).
>    
why would it break C code? of course a C frontend should generate only 
tailpadded types.
> I don't see a way of specifying two structures, but I like the idea of
> using a packed structure for inheritance and the "normal" one for
> types.
>    
or something like

%J = type { inherit %I, i8 }

the inherit keyword before %I removes the tailpadding


-Jochen




More information about the llvm-dev mailing list