[PATCH] D113741: [RFC][DwarfDebug][AsmPrinter] Support emitting function-local declaration for a lexical block

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 02:05:15 PST 2021


krisb added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:625-628
+  // For function-local type we may not yet set parents properly.
+  if (!ContextDIE->getUnit())
+    return createTypeDIE(Context, *ContextDIE, Ty);
+
----------------
ellis wrote:
> Where are we creating DIEs without giving them a parent. In a previous attempt @dblaikie mentioned we should avoid even temporarily creating DIEs without a parent because of the `getUnit()` function.
Right, this is a problem. I've opened another review request with refactoring for `createScopeChildrenDIE()` and `createScopeChildrenDIE()` that makes parent set right after creation of a DIE for local entity. Please, take a look if you have a chance.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113741



More information about the llvm-commits mailing list