[PATCH] D137139: [DWARF] Fix handling of .debug_aranges with -g1

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 07:59:14 PDT 2022


dblaikie added a comment.

This is the sort of thing I kind of wanted to avoid when we were talking about adding the aranges verifier - fixing bugs in aranges when instead we should be fixing bugs in consumers to not depend on aranges.

But anyway - if you really want/need aranges, perhaps a deeper fix would be good? We could emit aranges as CU ranges + data ranges instead of keeping an entirely separate list that can get out of sync? (& while we're at it, probably move the data ranges to the CU - rather than having to map them back from another independent data structure in DwarfDebug?)



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2250
+    for (const auto &R : Asm->MBBSectionRanges)
+      TheCU.getDwarfDebug().addArangeLabel(
+          SymbolCU(&TheCU, R.second.BeginLabel));
----------------
We're already in a DwarfDebug function, no need to retrieve the DwarfDebug object some other way.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137139



More information about the llvm-commits mailing list