[PATCH] D45045: [DebugInfo] Generate debug information for labels.

Hsiangkai Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 6 20:34:41 PDT 2018


HsiangKai added a comment.

In https://reviews.llvm.org/D45045#1189201, @vext01 wrote:

> Hi,
>
> I've been experimenting some more with this patch.
>
> It seems to me that if a label is optimised away, but you've requested it be preserved, then you get a DWARF label with a zero offset. Is that the expected behaviour? Should it be documented?
>
> E.g.:
>
>   < 6><0x000000dc>              DW_TAG_label
>                                   DW_AT_name                  __YK_BLK_2_19418_0
>                                   DW_AT_low_pc                0x00000000
>
>
> Thanks!


I expect that even the code is optimized out, the label will point to somewhere in the function. If the whole function is optimized out, the label should not exist any more. It should not have address zero.

Do you have any test snippet to reproduce the bug? Thanks.


Repository:
  rL LLVM

https://reviews.llvm.org/D45045





More information about the cfe-commits mailing list