[PATCH] D94976: [DWARF] Create subprogram's DIE in the unit specified by its DISubprogram

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 11:04:04 PST 2021


jmorse marked 2 inline comments as done.
jmorse added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:525-530
+    // Subprogram definitions should be created in the Unit that they specify,
+    // which might not be "this" unit when type definitions move around under
+    // LTO.
+    if (SP->isDefinition())
+      return &DD->constructSubprogramDefinitionDIE(SP);
     return getOrCreateSubprogramDIE(SP);
----------------
dblaikie wrote:
> Are these ever declarations/non-definitions? (I can't think of a place where we'd create a declaration as a scope) Perhaps this could just assert that the SP is a definition?
Not to my knowledge -- again, this isn't my comfort zone. I stuck an assertion in and ran a stage2 RelWithDebInfo build and it didn't fire, that'd good assurance IMO.


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

https://reviews.llvm.org/D94976



More information about the llvm-commits mailing list