<div dir="ltr">For C code, record layout decisions are made here:<div><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?view=markup">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?view=markup</a><br></div><div><br></div>LLVM's struct layout rules are only important if you aren't using clang.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 4, 2016 at 8:06 PM, Zeson Wu via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi.<div><br></div><div>Is the alignment of a struct be computed in the constructor of StructLayout class? I wonder that the position of a member in the struct has been considered in llvm? Because the alignment of a member is dependent to the position in the struct in AIX platform according to the table in <a href="http://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/proguide/alignment.html" target="_blank">http://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/proguide/alignment.html</a> (`power` alignment setting)</div><div><br></div><div><ol style="font-size:8.96px;margin-top:0.1em;margin-bottom:0.1em;padding-top:0.1em;padding-bottom:0.1em;color:rgb(0,0,0);font-family:Arial,sans-serif;background-color:rgb(255,255,255)"><li style="margin-top:0em;margin-bottom:0em;margin-left:0em">In aggregates, the first member of this data type is aligned according to its natural alignment value; subsequent members of the aggregate are aligned on 4-byte boundaries.</li></ol></div><div><br></div><div>Thanks</div><div><br></div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>