[llvm-commits] [llvm-gcc-4.2] r47655 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Duncan Sands baldrick at free.fr
Wed Feb 27 00:43:10 PST 2008


Hi Dale,

> Hack to handle darwin ppc32's weird choice of
> representation for bool.  Fixes
> gcc.dg-struct-layout-1/t009

I can't find this test in the testsuite, which is bad because without it
I'm pretty confused about what's going on!

> +    // Normally gcc reduces the size of bitfields to the size necessary
> +    // to hold the bits, e.g. a 1-bit field becomes QI.

So this is a union with a bitfield member?  If so, can you not just do:

(1) use isBitfield to see if it is a bitfield.
(2) rather than converting the type (which should be completely ignored in
the case of a bitfield), generate i8, i16 or whatever based on DECL_SIZE.

And don't condition this on PPC or other tests.  If the problem is what I'm
imagining it is, this is needed in general: though we usually get away with
it by using the type generated by gcc's struct layout, we don't in fact want
to use the types produced by gcc's struct layout for bitfields (we don't in
the rest of the struct conversion stuff).

Ciao,

Duncan.



More information about the llvm-commits mailing list