[PATCH] D49500: [DWARF v5] Refactor range lists dumping (NFC except for spelling changes in dump output).

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 11:22:06 PDT 2018


wolfgangp created this revision.
wolfgangp added reviewers: aprantl, JDevlieghere, dblaikie, probinson.
Herald added a subscriber: mgorny.

This refactor is motivated by the fact hat DWARF 5 location list tables are identical to range list tables in layout. The only differences are of course the entries themselves, so the code that handles table extraction and dumping of anything other than the entries themselves could be used for location list tables as well.

With that in mind, this proposed change introduces a template class "DWARFListTableBase", with a template parameter that is expected to be either a location list or a range list. The table header is broken out separately since it is not template dependent. The constructor takes 3 strings to identify the section name, a header displayed during dumping and a string characterizing the list as either "location" or "range", also used during dumping.

To facilitate range lists and location lists there is a new template class DWARFListType with the template parameter expected to be a list entry type, such as a location list entry or range list entry.

Finally, there is a small base class DWARFListEntryBase to handle commonalities between list entries.

DebugRnglistTable is now simply derived from DWARFListTableBase instantiated appopriately. I expect to refactor the location list table similarly.

This refactor is NFC, with the exception of the capitalization of words that are emitted during dumping. I decided to make everything lower case for consistency, but that can be easily changed, if there are any objections.

Please feel free to suggest alternatives for "DWARFListTable" and DWARFListType, etc. It feels a bit lacking in descriptiveness.


https://reviews.llvm.org/D49500

Files:
  include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
  include/llvm/DebugInfo/DWARF/DWARFListTable.h
  lib/DebugInfo/DWARF/CMakeLists.txt
  lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
  lib/DebugInfo/DWARF/DWARFListTable.cpp
  lib/DebugInfo/DWARF/DWARFUnit.cpp
  test/DebugInfo/X86/fission-ranges.ll
  test/DebugInfo/X86/rnglists-nobase.ll
  test/tools/llvm-dwarfdump/X86/debug_rnglists.s
  test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49500.156108.patch
Type: text/x-patch
Size: 43220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180718/07ece7f5/attachment.bin>


More information about the llvm-commits mailing list