<div dir="ltr">We don't really need to emit alignment information for bitfields anymore, we emit enough information in the MD to exactly describe the offset of the storage unit the bitfield is within (DIFlagBitField implies that the extraData field encodes this information).</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 10, 2016 at 12:50 PM, Victor Leschuk 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">Hello all,<br>
<br>
I am currently implementing support for DWARFv5 DW_AT_alignment attr and I got a question about align field in debug info section of IR/Bitcode. Currently it is being dumped almost in any case, however according to code we use align from DI* objects only when dealing with class/structure bitfields: DwarfUnit::constructMemberDIE.<br>
<br>
Dumping align information everywhere only for 1 case looks like overhead to me.<br>
<br>
Consider the following code:<br>
<br>
struct S {<br>
  char c;<br>
} s;<br>
<br>
When compiled with debug enabled in IR we get smth like that:<br>
<br>
!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !5, line: 1, size: 8, align: 8, elements: !7)<br>
<br>
Am I missing something? What is the purpose of "align: 8" here? Maybe we could include alignment information into DI* objects only when required (and thus dump it only when required): for types with bitfields and when alignas() was specified in code.<br>
<br>
Please advise.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Best Regards,<br>
Victor<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div>