[PATCH] D134817: Remove the dependency between lib/DebugInfoDWARF and MC

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 15:31:58 PDT 2022


clayborg added a comment.

Many of these changes involve modifying functions that are dumping some DWARF and the functions used to take a DIDumpOptions + MRI, but now take a DIDumpOptions + std::function<...>. We should add the callback into DIDumpOptions. I believe the "bool isEH" is also mainly needed for this function callback in order to make sure we get the right register number as sometimes DWARF register numbers differ from compiler register numbers found in .eh_frame.

So would adding more members to DIDumpOptions make these functions cleaner and easier to use?



================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:463-466
+  void dump(raw_ostream &OS, DIDumpOptions DumpOpts, bool IsEH,
+            std::function<Optional<StringRef>(uint64_t RegNum, bool isEH)>
+                Callback = nullptr,
+            unsigned IndentLevel = 1) const;
----------------
I would suggest we add the std::function callback to the DIDumpOptions since any DWARF that needs to dump something could be able to use the mapping of register number to register name. If "bool isEH" is also only used for this, maybe we can add that to DIDumpOptions as well.


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

https://reviews.llvm.org/D134817



More information about the llvm-commits mailing list