[LLVMdev] Matching struct layouts.

Duncan Sands baldrick at free.fr
Fri May 16 00:01:40 PDT 2008


> > If this is an arbitrary struct, it can be quite tricky.  Do you have
> > to worry about bitfields and variable sized fields (for example a
> > variable length array at the end)?  What about unions?
> 
> There are no bitfields, but it does have a variable length array at the end.
> There are no unions.

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).

Ciao,

Duncan.

PS: Please reply to the list as well as to me - that way others can
comment too.



More information about the llvm-dev mailing list