[PATCH] D144004: [DebugMetadata][DwarfDebug] Fix DWARF emisson of function-local imported entities (3/7)

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 05:15:18 PST 2023


jmmartinez added a comment.

I've added just a few minor remarks.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1082-1084
+  if (!includeMinimalInlineScopes() && !Scope->getInlinedAt())
+    for (const auto *Decl : DD->getLocalDeclsForScope(Scope->getScopeNode()))
+      DeferredLocalDecls.insert(Decl);
----------------
NIT: You could avoid writing the for loop


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1646-1649
+  if (LexicalBlockDIEs.count(LB))
+    return LexicalBlockDIEs[LB];
+
+  return nullptr;
----------------
Nit: `lookup` returns the value in the map or returns a default value.


================
Comment at: llvm/test/DebugInfo/Generic/split-dwarf-local-import3.ll:17-36
+; CHECK:   DW_TAG_subprogram
+; CHECK:     DW_AT_name	("foo")
+; CHECK:     DW_TAG_imported_declaration
+; CHECK:     NULL
+
+; CHECK:   DW_TAG_base_type
+; CHECK:     DW_AT_name	("int")
----------------
I'd be tempted to match the offset of the abstract subprogram and of the imported declaration too.
At least for me, it makes clear the intention of the test without running it.

What do you think ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144004



More information about the llvm-commits mailing list