diff options
author | Pavel Labath <pavel@labath.sk> | 2019-08-05 09:21:47 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-08-05 09:21:47 +0000 |
commit | d5d47a3574823635fddef3bba3de37e2a5ea0d76 (patch) | |
tree | 1f0f9b4cde535e98639ac220cb6f45e80aab4dfd /lldb/source/API/SBModule.cpp | |
parent | 8ed8353fc45e3906f7fd8dde1072bce7b54aca62 (diff) | |
download | bcm5719-llvm-d5d47a3574823635fddef3bba3de37e2a5ea0d76.tar.gz bcm5719-llvm-d5d47a3574823635fddef3bba3de37e2a5ea0d76.zip |
Remove SymbolVendor::GetSymtab
Summary:
This patch removes the GetSymtab method from the SymbolVendor, which is
a no-op as it's implementation just forwards to the relevant SymbolFile.
Instead it creates a Module::GetSymtab, which calls the SymbolFile
method directly.
All callers have been updated to use the Module method directly instead
of a two phase GetSymbolVendor->GetSymtab search, which leads to reduced
intentation in a lot of deeply nested code.
Reviewers: clayborg, JDevlieghere, jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D65569
llvm-svn: 367820
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index e3c48cfcecc..6f856de53a1 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -290,11 +290,8 @@ SBSymbolContextList SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) { } static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) { - if (module_sp) { - SymbolVendor *symbols = module_sp->GetSymbolVendor(); - if (symbols) - return symbols->GetSymtab(); - } + if (module_sp) + return module_sp->GetSymtab(); return nullptr; } @@ -302,11 +299,8 @@ size_t SBModule::GetNumSymbols() { LLDB_RECORD_METHOD_NO_ARGS(size_t, SBModule, GetNumSymbols); ModuleSP module_sp(GetSP()); - if (module_sp) { - Symtab *symtab = GetUnifiedSymbolTable(module_sp); - if (symtab) - return symtab->GetNumSymbols(); - } + if (Symtab *symtab = GetUnifiedSymbolTable(module_sp)) + return symtab->GetNumSymbols(); return 0; } |