Hi Folks,<br><br>Bear with me, I'm a newbie to LLVM. <br><br>I've read the language reference and the mailing list archive. One area of the semantics of the Structure type that hasn't been discussed is whether fields in the structure get re-arranged to better suit the target machine's natural alignment, ala what happens in C.
<br><br>For example would this structure on a 32-bit machine:<br><br><tt>{ i16, i32, i16 }</tt> <br><br>get re-arranged to<br><br><tt>{ i16, i16, i32 }</tt> or <tt>{ i32, i16, i16 }</tt><br><br>Does LLVM guarantee a consistent code generation in this case for all platforms, or is this considered target-specific and a decision left up to the back-end of the target platform?
<br><br>Furthermore if re-arrangement does occur, how does this affect the semantics of GetElementPtr when it is used for pointer calculation of a Structure? For example if I had:<br><br><pre>%BLAH = type { i16, i32, i16 }
<br>...<br>%firstField = getelementptr %BLAH* %instance, i32 1, i32 0</pre><br>In this example I want to access the first 16-bit integer field of Structure BLAH, so  the last argument to GetElementPtr is index 0, but if the fields gets re-arranged, how do I know which index to use?
<br><br>Thanks,<br>Kean<br>