[PATCH] D45556: [DebugInfo] Generate DWARF debug information for labels.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 00:00:56 PDT 2018


HsiangKai added a comment.

In https://reviews.llvm.org/D45556#1120815, @tyb0807 wrote:

> In https://reviews.llvm.org/D45556#1117242, @HsiangKai wrote:
>
> > In https://reviews.llvm.org/D45556#1114350, @tyb0807 wrote:
> >
> > > Thank you for the patch.
> > >
> > > It seems to me that with `requireLabelBeforeInsn`, the label will later be emitted as a temporary symbol with a unique but unspecified name (in `DebugHandleBase::beginInstruction()`). Is it correct?
> >
> >
> > Yes, I generate a temporary label before the label intrinsic. In this way, I could get the address of the label afterward.
>
>
> Yes, I mean that the label will later be named differently in the asm file than in the source? I don't know if this is something we should care about though, I'm just speaking from an user point of view


There is no 'label' entity in LLVM IR. The 'label' in C source code will be transformed into 'basic block' in LLVM.
So, we could not get the original name except from dbg.label intrinsic and metadata. That is why I created new kind of intrinsic and metadata for labels for debugging purpose.
I will print the label name in asm comments.


Repository:
  rL LLVM

https://reviews.llvm.org/D45556





More information about the llvm-commits mailing list