[LLVMdev] Structure Types and ABI sizes

Jochen Wilhelmy j.wilhelmy at arcor.de
Thu Feb 24 07:13:06 PST 2011


> If %I is not a "POD for the purposes of layout" type, that it's tail
> padding MUST be overlapped when inherited from.  In this case, we
> end up creating two types for %I, %I and %I' and use %I' as the
> type when it is inherited from.
>    
But this is the question why two types in this case.

if

%I = type { i32, i8 };

then %I has 8 bytes if used directly and when used in %J

%J = type { %I, i8 }

then %I has only 5 bytes. Of course %I' could be

%I' = type { i32, i8, i16 };
or
%I' = type { i32, i8, i8, i16 };

but I don't see the point of this since %I already does the job
or do I miss something?


-Jochen




More information about the llvm-dev mailing list