[PATCH] D140478: [RISCV] For Dwarf v5, emit indices into .debug_addr for range list entries

Venkata Ramanaiah Nalamothu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 11:57:41 PST 2023


RamNalamothu added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1299
+    return MF->hasRelaxationsEnabled();
+  return TM.getMCSubtargetInfo()->checkFeatures("+relax");
+}
----------------
craig.topper wrote:
> This also feels like it should be a virtual function.
That's what I started with in the previous versions of this revision https://reviews.llvm.org/D140478?vs=on&id=484785#toc but @dblaikie mentioned an interesting point that `-mrelax` is a subtarget feature, which is true at least for RISC-V. Hence I thought having these checks per machine function as in `MachineFunction::hasRelaxationsEnabled` would be right/better. Please see my previous replies to @dblaikie.

I can introduce a virtual function in `MCSubtargetInfo` but that will defeat the purpose of `MCSubtargetInfo::checkFeatures`.

And another challenge is we don't have enough context in `DwarfDebug` to know if relaxations are enabled or not. We have to go through `AsmPrinter`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140478



More information about the llvm-commits mailing list