DWARF: Provide accessors to DIERef fields
authorPavel Labath <pavel@labath.sk>
Thu, 20 Jun 2019 08:24:46 +0000 (08:24 +0000)
committerPavel Labath <pavel@labath.sk>
Thu, 20 Jun 2019 08:24:46 +0000 (08:24 +0000)
commit0de98ebd00d1955100d440eee725ccd0ca01b605
treec081a83278adcbe9bf15d011b98eaa0ffc4bfa33
parent3ba20e943edba3428c3b9631df63798da81cade1
DWARF: Provide accessors to DIERef fields

Summary:
Instead of accessing the fields directly, use accessor functions to
provide access to the DIERef components. This allows us to decouple the
external interface, from the internal representation. The external
interface can use llvm::Optional and similar goodies, while the data can
still be stored internally in a more compact representation.

I also document the purpose of the existing DIERef fields.

The main motivation for this change is a need to introduce an additional
field to the DIERef class, but I believe the change has its own merit.

Reviewers: JDevlieghere, aprantl, clayborg

Subscribers: arphaman, lldb-commits

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

llvm-svn: 363910
lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp