[llvm-commits] [126245] Fix http://lists.cs.uiuc.edu/pipermail/llvm-commits/ Week-of-Mon-20070416/047943.html
Devang Patel
dpatel at apple.com
Thu Apr 19 10:48:57 PDT 2007
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.
More information about the llvm-commits
mailing list