[PATCH] D143397: [WIP][llvm][DebugInfo] Add DW_TAG_imported_declaration to accelerator tables

Michael Buch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 11:12:01 PST 2023


Michael137 added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1295
+    DD->addAccelNamespace(*CUNode, Name, *IMDie);
+  }
 
----------------
dblaikie wrote:
> Michael137 wrote:
> > Since import declarations could have empty names I'll have to decide what to do here w.r.t. accelerator tables. The spec says in the case of an empty name we can refer to the entity by the name of the entity it is importing.
> You could go find the name of the entity it's importing to support this, I suppose? Maybe worth a comment/FIXME/etc?
> 
> You could try adding a temporary/non-committed assertion here that Name is !empty & bootstrap clang or the like to see if there are cases where we emit an imported declaration with an empty name?
Ah apparently things like:
```
using ::nullptr_t;                        
using ::ptrdiff_t _LIBCPP_USING_IF_EXISTS;
using ::size_t _LIBCPP_USING_IF_EXISTS;   
```

Generate empty `DW_AT_imported_declaration` entries. But apparently this is not supported for namespaces, so I think we can just not handle the empty name case and add a comment as to why we're not doing that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143397



More information about the llvm-commits mailing list