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

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 17 08:29:48 PDT 2018


aprantl added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1232
 
+void DwarfDebug::createConcreteLabel(DwarfCompileUnit &TheCU,
+                                     LexicalScope &Scope,
----------------
HsiangKai wrote:
> aprantl wrote:
> > This and the next function looks like it is almost the same code as createConcreteVariable and collectVariableInfo. Could the implementation be shared (see my comment on DwarfLabel)?
> I took DILocalVariable as the reference model. So, you will find that some implementation is similar. However, processing of labels is much simpler than processing of variables. I do not need to handle location list for variables, instruction ranges that variables are accessible, local variables v.s. argument variables, and data types, etc.
> 
> The only similarity is they are both local entities in a function. They have function scope. They have DILocation to tell users where they are. I have no idea how to combine these two classes and make label processing simple and make sense.
+ @dblaikie: Do you also agree that it is better to keep labels and variables separate or should we make an effort to share bits of the implementation?


Repository:
  rL LLVM

https://reviews.llvm.org/D45556





More information about the llvm-commits mailing list