[PATCH] D94639: [DebugInfo][CodeView] Change in line tables only mode to emit parent/context scopes for functions, using declarations for types

Sergey Makarov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 31 13:01:37 PDT 2021


SeTSeR added a comment.

In D94639#2917445 <https://reviews.llvm.org/D94639#2917445>, @rnk wrote:

> In D94639#2917340 <https://reviews.llvm.org/D94639#2917340>, @SeTSeR wrote:
>
>> Hello! As far as I understand, Clang does not preserve info about namespace for functions declared in namespaces with `-gline-numbers-only` flag. Is there any way to retrieve this info for DWARF? I thought FIXME at line 261 in CGDebugInfo was addressing exactly this issue.
>
> No, I don't think there is a way to achieve this.
>
> The current -gcodeview -gline-tables-only behavior as I understand it is to emit regular debug info, but skip two key source of info:
>
> - never emit complete class declarations, always use forward decls
> - never emit variable locations, only emit source locations
>
> For DWARF, I think we also try to skip namespace scopes, class forward decls, function types, and other things like that, but I forget the details.
>
> I happen to know that many users of -gline-tables-only are very space constrained: we can't simply port this change from CV to DWARF. We'd have to add a new flag. The bar for such a flag is high. If someone provides a well-motivated use case, we could consider it.

Thank you for the detailed answer. I'll discuss our use case with our team. Should I create a separate ticket for this? Or maybe it would be better if I submitted the PR adding this flag?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94639/new/

https://reviews.llvm.org/D94639



More information about the cfe-commits mailing list