On Jul 22, 2005, at 11:27 AM, Dale Johannesen wrote:
On Jul 22, 2005, at 11:07 AM, Chris Lattner wrote:
I'm trying to determine (in target-independent code) what the
*minimum* target alignment of a type is. For example, on darwin,
double's are normally 4-byte aligned, but are 8-byte aligned in
some cases (e.g. when they are the first element of a struct).
TYPE_ALIGN on a double returns 8 bytes, is there any way to find
out that they may end up being aligned to a 4-byte boundary?
#pragma pack or attribute((__aligned__)) can result in arbitrary
misalignments for any type.
Understood. I'm just looking for the minimum type alignment without
user alignment. It appears that this is impossible to get from the
targets, due to the way the targets can override type alignments in
(almost completely) general ways. Is this true?
-Chris