[PATCH] D108261: [DebugInfo] Fix end_sequence of debug_line in LTO Object

Kyungwoo Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 13 10:24:21 PST 2021


kyulee added inline comments.


================
Comment at: llvm/include/llvm/MC/MCDwarf.h:221
+  void addEndEntry(MCSymbol *EndLabel) {
+    if (PrevSec) {
+      auto *LastEntry = &MCLineDivisions[PrevSec].back();
----------------
dblaikie wrote:
> When does this case come up? I think all of this would only happen when PrevCU was non-null/had been populated with some content first, right?
Correct. I changed it to an assert.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2182
+void DwarfDebug::terminateLineTableForPrevCU(const DwarfCompileUnit *NewCU) {
+  if (PrevCU == nullptr || PrevCU == NewCU)
+    return;
----------------
dblaikie wrote:
> presumably this function shouldn't be called if PrevCU == NewCU, right? (maybe that could be asserted, rather than tested)
I checked this condition at the call-site and updated the comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2186
+  const auto &CURanges = PrevCU->getRanges();
+  if (!CURanges.empty()) {
+    auto &LineTable = Asm->OutStreamer->getContext().getMCDwarfLineTable(
----------------
dblaikie wrote:
> Does is this empty? I /think/ that "PrevCU" is only set when PrevCU has already been populated with some content, right?
Yeah. I deleted the check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108261



More information about the llvm-commits mailing list