[PATCH] D133092: [clang] fix generation of .debug_aranges with LTO

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 23:42:48 PDT 2022


dblaikie added a comment.

(generally seems OK - maybe include a comment about this being a less-than-perfect solution (the better solution would be to encode this in IR metadata (DICompileUnit) if it's reasonable to respect this option on a per-CU basis (which it probably is, though that'd be a bit of backend work) - or to set it as IR global metadata (like how the DWARF version is encoded - probably using the same IR linker merging strategy, of choosing the highest value (so if any module has aranges, then a linked module has aranges too - even for the CUs that had it turned off) if it's really not feasible to support on a per-CU basis) but probably OK-enough, given that aranges is hopefully on the way out & not worth all the work of the deeper fix)



================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:512-513
+    // handle SCE (like in Clang.cpp::renderDebugOptions())
+    bool NeedAranges = Args.hasArg(options::OPT_gdwarf_aranges);
+    if (NeedAranges) {
+      CmdArgs.push_back(Args.MakeArgString("-mllvm"));
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133092



More information about the cfe-commits mailing list