On Apr 17, 2007, at 11:15 PM, Duncan Sands wrote: > Hi Devang, > >> if >> (StartOffsetInBits > FirstUnallocatedByte*8) >> >> is true then >> >> (StartOffsetFromByteBoundry == 0) >> >> is always true. If so, we could simply this even further. In other >> words, if we need pad bytes for a new field then it always starts at >> byte boundary. Can you think of an example where this is not true ? > > yes, this need not be true in Ada, where bitfields can be placed > wherever you like,
Is it true for very first bitfield also ? > for example > > type Second_Bitfield_Not_At_Bitoffset_Zero is record > A : Character; > B : Integer; > end record; > for Second_Bitfield_Not_At_Bitoffset_Zero use record > A at 0 range 0 .. 7; > B at 0 range 27 .. 64; > end record; so here, range is not value range. In that case size of B should be 64. No? - Devang > > -- "gaps__second_bitfield_not_at_bitoffset_zero", size 72 > -- Fields: > -- "a", size 8, offset 0, bit offset 0 > -- "b", size 32, offset 0, bit offset 27 > > Best wishes, > > Duncan. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits