[PATCH] D69847: DWARFDebugLoc(v4): Add an incremental parsing function

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 07:42:26 PST 2019


labath created this revision.
labath added reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
labath added a parent revision: D69672: DWARFDebugLoclists: Move to a incremental parsing model.

This adds a visitLocationList function to the DWARF v4 location lists,
similar to what D69672 <https://reviews.llvm.org/D69672> does for DWARF v5. It follows the approach outlined
in that patch, where the parsed form is always stored in the DWARF v5
format, which allows for generic code to be built on top of that. v4
location lists are "upgraded" during parsing, and then this upgrade is
undone while dumping.

The previous function (parseOneLocationList) was rewritten on top of the
new API.

In order to keep things byte sized, there are a number of things I
intentially omitted from this patch. These are:

- dumpLocationList(): I'll do this in a separate patch along with

changing the dump format to be more similar to the v5 format and
hopefully share some code with it.

- removing parseOneLocationList and friends: Some of the users of this

function should really be using a different kind of an api. For instance
the statistics code should use the api which abstracts the v4/v5
differences and handles all base address stuff (which is incidentally
the same thing that lldb needs too). I plan to update the users to use
the new api first, once that is available. Then this code can be
removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69847

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
  llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
  llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
  llvm/tools/llvm-dwarfdump/Statistics.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69847.227875.patch
Type: text/x-patch
Size: 15312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191105/af397318/attachment.bin>


More information about the llvm-commits mailing list