[lldb/DWARF] Don't hold a unique SymbolFileDWARFDwo in a DWARFUnit
authorPavel Labath <labath@google.com>
Thu, 6 Feb 2020 14:24:39 +0000 (06:24 -0800)
committerPavel Labath <labath@google.com>
Fri, 14 Feb 2020 10:09:45 +0000 (11:09 +0100)
commit9dc84e9b02d1e402503906099d42fbae4da7d8d9
tree949ab0a25872810ff2cbe6e94b4396edb3bdc32b
parenta82f35e17621a036cb726244ee5cb9708545fb93
[lldb/DWARF] Don't hold a unique SymbolFileDWARFDwo in a DWARFUnit

This is the second dwp preparatory patch. When a SymbolFileDWARFDwo will
hold more than one split unit, it will not be able to be uniquely owned
by a single DWARFUnit. I achieve this by changing the
unique_ptr<SymbolFileDWARFDwo> member of DWARFUnit to
shared_ptr<DWARFUnit>. The shared_ptr points to a DWARFUnit, but it is
in fact holding the entire SymbolFileDWARFDwo alive. This is the same
method used by llvm DWARFUnit (except that is uses the DWARFContext
class).

Differential Revision: https://reviews.llvm.org/D73782
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h