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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 12:29:45 PDT 2016


On Sat, Sep 10, 2016 at 12:25 PM Victor Leschuk <vleschuk at accesssoftek.com>
wrote:

> vleschuk added a comment.
>
> > In https://reviews.llvm.org/D24425#539028, @dblaikie wrote:
>
>
>
>
> >   Alignment value (whether it is default or user-defined) must be
> present in IR in order to be able to generate correct code,
>
>
>
>
> > I'm not sure I follow this ^ - the metadata here is only for debug info.
> It's not used for correctness of the resulting program. (the alignment of
> pointers in the IR for actual code generation is stored separately).
>
>
> Correct. Debug Info dump doesn't influence code generation. Bad example
> from my side.
>
> > I'll try to rephrase:
>
>
>
>
> > Is the alignment currently emitted in the debug info IR metadata used
> for anything? Seems it's used for bitfield related things, but perhaps
> that's not the right solution/we could do that another way? So that the
> alignment just corresponds directly to the DW_AT_alignment (eg: when
> present, emit an alignment attribute, otherwise don't) to keep the metadata
> simple.
>
>
> Ah, I got it now. You suggest the following way:
>
> - Do not add DINode::FlagAlignment
> - Do not add alignment to DI* objects when creating them unless alignment
> was forced by user
> - When generating DWARF output emit DW_AT_alignment if DI* object has
> non-zero alignment field
>
> I have looked through the code and you seem to be correct, actually the
> align value from DI* objects is used only when working with bitfields. I
> think I should consult with llvm-dev@ before breaking anything.
>

Yep - sounds great! :)


>
>
> https://reviews.llvm.org/D24425
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160910/e912c760/attachment.html>


More information about the llvm-commits mailing list