Size/Alignment handling bug?

I think there's possible bug in alignment handling. When getTypeInfo function
in TargetData.cpp is called on:

   [100 x short]

it always returns 200 as the size. However, if alignment for short is '4',
then each array element should be aligned at 4-byte boundary, and the total
size of the array is more like 400.

For a while, I've made the attached local modification. Does it makes sense?

- Volodya

P.S. It's a lot of fun writing codegen for a target which has no support for
addressing/working with individual bytes :wink:

TargetData.diff (659 Bytes)

I think there's possible bug in alignment handling. When getTypeInfo function
in TargetData.cpp is called on:

   [100 x short]

it always returns 200 as the size. However, if alignment for short is '4',
then each array element should be aligned at 4-byte boundary, and the total
size of the array is more like 400.

For a while, I've made the attached local modification. Does it makes
sense?

Sounds good. Applied:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040628/015613.html

P.S. It's a lot of fun writing codegen for a target which has no support
for addressing/working with individual bytes :wink:

Yeah, no kidding! Thanks for the bug fixes in this area! :slight_smile:

-Chris