[PATCH] D24425: DebugInfo: support for DWARFv5 DW_AT_alignment attribute

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 09:47:02 PDT 2016


dblaikie added a comment.

In https://reviews.llvm.org/D24425#539340, @vleschuk wrote:

> In https://reviews.llvm.org/D24425#539028, @dblaikie wrote:
>
> > What's the purpose of the flag? Could we just use the non-zero value of the alignment attribute as the signal of whether to emit the DW_AT_alignment attribute? (eg: if the alignment is specified, emit it - simple?)
>
>
> The alignment could be not specified and default alignment is used. Consider the following example:
>
>   struct S {
>   } s;
>
>
> This will result in the following IR code:
>
>   !5 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !1, line: 1, align: 8, elements: !2)
>
>
> And getAlignInBits() will return 8. Thus we need to mark entities with non-default alignment.


Is the alignment used for anything in this case? Could we just remove it & make it so that whenever it's present we put the DW_AT_alignment attribute on the entity?


https://reviews.llvm.org/D24425





More information about the llvm-commits mailing list