[PATCH] D109343: [DebugInfo] Enhance DIImportedEntity to accept children entities for renamed variables

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 13:07:23 PDT 2021


dblaikie added a comment.

The subject might be slightly misleading - DIImportedEntity already supports importing variables (see C++ like this:

  namespace ns {
  extern int i;
  int i;
  }
  namespace ns2 {
  using ns::i;
  }
  int main() {
    return ns2::i;
  }

which produces a DW_TAG_imported_declaration in DW_TAG_namespace ns2 that imports the DW_TAG_variable i from DW_TAG_namespace ns.

. This patch is specifically about supporting a single imported entity declaration importing multiple entities at the same time, but not a whole namespace of them?

Hmm, nope - it looks like it's only testing importing a single variable. What sort of DWARF are you expecting to generate when importing multiple variables (when "children" has a size greater than 1). Oh, in the implementation in DwarfDebug it's still generating separate DW_TAG_imported_declaration for each thing - so why not encode these as separate DIImportedDeclarations, which would already be supported in the current IR handling, so far as I can tell?


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

https://reviews.llvm.org/D109343



More information about the llvm-commits mailing list