[llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp

Duncan Sands baldrick at free.fr
Mon Jan 28 11:19:58 PST 2008


Hi Devang,

> >> +        // Skip 'int:0', which just affects layout.
> >> +        unsigned FieldSizeInBits =  
> >> TREE_INT_CST_LOW(DECL_SIZE(Field));
> >> +        if (FieldSizeInBits == 0)
> >> +          continue;
> >
> > This is probably safe (not completely clear), but why do you need to  
> > do it at all?
> 
>    getLLVMFieldFor() does not handle zero-sized bit-fields.

so this is fixing a getLLVMFieldFor crash noticed while working on
struct passing?  I have a patch somewhere that causes zero-sized
bit-fields to be indexed properly (I thought it had been applied
at some point, but I guess it fell through a crack...).  I will
dig it out and apply it, since I think it is better if you can
always rely on every gcc field having an LLVM field index (except
for variable offset fields, for which that is impossible).

Ciao,

Duncan.



More information about the llvm-commits mailing list