[PATCH] D123534: [dwarf] Emit a DIGlobalVariable for constant strings.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 11 19:08:02 PDT 2022


hctim added a comment.

In D123534#3504789 <https://reviews.llvm.org/D123534#3504789>, @rnk wrote:

> This seems reasonable, but I worry about the consequences of creating lots of unnamed global variables. What will gdb do with so many unnamed globals? What will the PDB linker do with all these unnamed globals? I can't answer these questions, and you're welcome to try and find out, but I predict there will be problems, so just be aware of that possibility.

Not sure about PDB. I did run a quick test with `gdb`, and very unscientifically, didn't notice any difference in usability or errors between pre- and post-this patch on a `clang` invocation under gdb.

> Looking at the S_GDATA32 record format, there is no place for the file & line info:
> https://github.com/microsoft/microsoft-pdb/blob/master/include/cvinfo.h#L3629
> It's just type info & name, really, so there's not much point in creating these when emitting codeview. It's probably best to filter these unnamed globals out in AsmPrinter/CodeViewDebug.cpp rather than changing the IR clang generates.

Sorry, I know pretty nothing about PDB. Are you thinking that these DIGlobalVariables should be filtered out by this patch when outputting PDB, or a subsequent patch? I don't even have a Windows machine, so I wouldn't be at all confident in writing such a patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123534



More information about the llvm-commits mailing list