[PATCH] D136039: [DebugInfo] Fix potential CU mismatch for attachRangesOrLowHighPC

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 08:48:11 PDT 2022


dblaikie added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1016
                                                    LexicalScope *Scope) {
-  DIE &ScopeDIE = updateSubprogramScopeDIE(Sub);
+  DIE *SPDie = getOrCreateSubprogramDIE(Sub, includeMinimalInlineScopes());
+  DwarfCompileUnit *ContextCU =
----------------
Hmm, I'm not following - can you help me understand why this got pulled out of `updateSubprogramScopeDIE`?


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:1017-1018
+  DIE *SPDie = getOrCreateSubprogramDIE(Sub, includeMinimalInlineScopes());
+  DwarfCompileUnit *ContextCU =
+      static_cast<DwarfCompileUnit *>(SPDie->getUnit());
+  DIE &ScopeDIE = ContextCU->updateSubprogramScopeDIE(Sub, SPDie);
----------------
Could use auto here, since the type is explicit in the static_cast on the right hand side. Might make it fit in a single line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136039



More information about the llvm-commits mailing list