[PATCH] D114350: [DwarfCompileUnit] Set parent DIE right after creating a local entity

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 10:17:14 PST 2021


ellis accepted this revision.
ellis added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:524
 // Construct a DIE for this scope.
-void DwarfCompileUnit::constructScopeDIE(
-    LexicalScope *Scope, SmallVectorImpl<DIE *> &FinalChildren) {
+void DwarfCompileUnit::constructScopeDIE(LexicalScope *Scope,
+                                         DIE &ParentScopeDIE) {
----------------
A better name would be `createInlinedScopeDIE()`, but `constructInlinedScopeDIE()` already exists. Should we merge these two functions together? Or maybe we can rename the second to `createInlinedSubprogramDIE()`.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1045
+
+  // Emit lables.
+  for (DbgLabel *DL : DU->getScopeLabels().lookup(Scope))
----------------



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1056
+      if (Vars.Args.empty() && Vars.Locals.empty() &&
+          ImportedEntities[LS->getScopeNode()].empty()) {
+        createAndAddScopeChildren(LS, ScopeDIE);
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114350



More information about the llvm-commits mailing list