[PATCH] D103131: support debug info for alias variable

kamlesh kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 25 19:06:38 PDT 2021


kamleshbhalui added a comment.

In D103131#2780997 <https://reviews.llvm.org/D103131#2780997>, @dblaikie wrote:

> Looks like GCC emits aliases as a `DW_TAG_variable` without a location, not as a `DW_TAG_imported_declaration` - what gave you the inspiration to do it in this way? (I think it's probably good, but DWARF doesn't lend itself to novelty so much... can be good to stick with how other folks already do things since it'll be what consumers already know how to handle)
>
> How's this work if the alias target isn't declared in the source - but in inline assembly instead? (I guess GCC probably handles that OK, but the Clang strategy here might not cope with it)



> what gave you the inspiration to do it in this way?

Actually, I got the idea from the discussion in the defect.

> How's this work if the alias target isn't declared in the source

gcc spec says that alias target has to be in the same source.
https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
it would be great if you share an example if I misunderstood you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103131



More information about the cfe-commits mailing list