Merge GetCompileUnitAtOffset + GetCompileUnitContainingDIEOffset
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 6 May 2019 12:01:38 +0000 (12:01 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 6 May 2019 12:01:38 +0000 (12:01 +0000)
commit4ce1c3c3ff6581db208e9802ff98e7c3fd581006
tree4a858cbdf7180ac59da01f836f4a228afad54a3c
parentd672d0e2462e91709ed6e4aa764501a1b7cd5388
Merge GetCompileUnitAtOffset + GetCompileUnitContainingDIEOffset

These two methods are very similar and various refactorizations need to modify
both similar ways.

One could also just remove GetCompileUnitAtOffset and make
GetCompileUnitContainingDIEOffset to also accept offset of the CU itself
(currently it accepts only DIE offsets after the CU header).
But that would be less safe regarding some internal sanity checking.

Further code refactorization has been suggested by Pavel Labath.

Differential Revision: https://reviews.llvm.org/D61498

llvm-svn: 360038
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h