DWARFDebugLoclists: Move to a incremental parsing model
authorPavel Labath <pavel@labath.sk>
Thu, 31 Oct 2019 14:05:33 +0000 (15:05 +0100)
committerPavel Labath <pavel@labath.sk>
Wed, 6 Nov 2019 15:25:06 +0000 (16:25 +0100)
commite1f8c8a16f441aed3aaa6262f932854b74e4f97c
tree06856f51bebd8074d5d52be7fb084e0785f0bb58
parentbde32933027a096b6cfe14b0e9385ac1005fc28a
DWARFDebugLoclists: Move to a incremental parsing model

Summary:
This patch stems from the discussion D68270 (including some offline
talks). The idea is to provide an "incremental" api for parsing location
lists, which will avoid caching or materializing parsed data. An
additional goal is to provide a high level location list api, which
abstracts the differences between different encoding schemes, and can be
used by users which don't care about those (such as LLDB).

This patch implements the first part. It implements a call-back based
"visitLocationList" api. This function parses a single location list,
calling a user-specified callback for each entry. This is going to be
the base api, which other location list functions (right now, just the
dumping code) are going to be based on.

Future patches will do something similar for the v4 location lists, and
add a mechanism to translate raw entries into concrete address ranges.

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69672
llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
llvm/test/CodeGen/X86/debug-loclists.ll
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists.test
llvm/test/DebugInfo/X86/fission-ranges.ll
llvm/test/DebugInfo/X86/stack-value-piece.ll
llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s