llvm-project/lldb/tools
Pavel Labath e0119909a6 SymbolVendor: Move compile unit handling into the SymbolFile class
Summary:
SymbolFile classes are responsible for creating CompileUnit instances
and they already need to have a notion of the id<->CompileUnit mapping
(because of APIs like ParseCompileUnitAtIndex). However, the
SymbolVendor has remained as the thing responsible for caching created
units (which the SymbolFiles were calling via convoluted constructs like
"m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(...)").

This patch moves the responsibility of caching the units into the
SymbolFile class. It does this by moving the implementation of
SymbolVendor::{GetNumCompileUnits,GetCompileUnitAtIndex} into the
equivalent SymbolFile functions. The SymbolVendor functions become just
a passthrough much like the rest of SymbolVendor.

The original implementations of SymbolFile::GetNumCompileUnits is moved
to "CalculateNumCompileUnits", and are made protected, as the "Get"
function is the external api of the class.
SymbolFile::ParseCompileUnitAtIndex is made protected for the same
reason.

This is the first step in removing the SymbolVendor indirection, as
proposed in
<http://lists.llvm.org/pipermail/lldb-dev/2019-June/015071.html>. After
removing all interesting logic from the SymbolVendor class, I'll proceed
with removing the indirection itself.

Reviewers: clayborg, jingham, JDevlieghere

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 366791
2019-07-23 09:24:02 +00:00
..
argdumper [CMake] `install-distribution` for LLDB on Darwin 2019-07-10 11:09:29 +00:00
compact-unwind *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
darwin-debug [CMake] `install-distribution` for LLDB on Darwin 2019-07-10 11:09:29 +00:00
darwin-threads the thread id is easier to read in base16. 2018-03-06 23:33:02 +00:00
debugserver Remove Xcode project remnants 2019-07-22 21:51:04 +00:00
driver [windows] re-call signal in sigint_handler for Windows 2019-07-12 04:43:46 +00:00
intel-features Delete unnecessary copy ctors 2019-05-22 08:38:23 +00:00
lldb-instr [Reproducers] Capture return values of functions returning by ptr/ref 2019-04-03 21:31:22 +00:00
lldb-mi [LLDB] Remove lldb-mi 2019-07-18 17:06:06 +00:00
lldb-perf/darwin/sketch Remove lldb-perf 2019-07-08 21:38:34 +00:00
lldb-server [CMake] Remove lldb-server from LLDB.framework 2019-05-29 11:28:11 +00:00
lldb-test SymbolVendor: Move compile unit handling into the SymbolFile class 2019-07-23 09:24:02 +00:00
lldb-vscode [lldb] Handle EOF from `lldb-vscode` 2019-07-16 06:34:44 +00:00
CMakeLists.txt [CMake] Align debugserver with lldb-server on Darwin 2019-07-20 11:18:31 +00:00