diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-10-17 19:56:40 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-10-17 19:56:40 +0000 |
commit | 1ad655e255090620705eb4ce85d869a54d971912 (patch) | |
tree | 0aea7b3e59e4569096a15f8ab9f661e4595983b7 /lldb/source/API/SBModule.cpp | |
parent | e3905dee0044c8b6c5f3a9cf46b9b6fe45039da6 (diff) | |
download | bcm5719-llvm-1ad655e255090620705eb4ce85d869a54d971912.tar.gz bcm5719-llvm-1ad655e255090620705eb4ce85d869a54d971912.zip |
Modernize the rest of the Find.* API (NFC)
This patch removes the size_t return value and the append parameter
from the remainder of the Find.* functions in LLDB's internal API. As
in the previous patches, this is motivated by the fact that these
parameters aren't really used, and in the case of the append parameter
were frequently implemented incorrectly.
Differential Revision: https://reviews.llvm.org/D69119
llvm-svn: 375160
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 5eb0f54bed6..6cc6d2628ac 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -282,8 +282,7 @@ SBSymbolContextList SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) { SBSymbolContextList sb_sc_list; const ModuleSP module_sp(GetSP()); if (sb_file_spec.IsValid() && module_sp) { - const bool append = true; - module_sp->FindCompileUnits(*sb_file_spec, append, *sb_sc_list); + module_sp->FindCompileUnits(*sb_file_spec, *sb_sc_list); } return LLDB_RECORD_RESULT(sb_sc_list); } @@ -342,8 +341,9 @@ lldb::SBSymbolContextList SBModule::FindSymbols(const char *name, Symtab *symtab = GetUnifiedSymbolTable(module_sp); if (symtab) { std::vector<uint32_t> matching_symbol_indexes; - const size_t num_matches = symtab->FindAllSymbolsWithNameAndType( - ConstString(name), symbol_type, matching_symbol_indexes); + symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type, + matching_symbol_indexes); + const size_t num_matches = matching_symbol_indexes.size(); if (num_matches) { SymbolContext sc; sc.module_sp = module_sp; @@ -398,12 +398,11 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name, lldb::SBSymbolContextList sb_sc_list; ModuleSP module_sp(GetSP()); if (name && module_sp) { - const bool append = true; const bool symbols_ok = true; const bool inlines_ok = true; FunctionNameType type = static_cast<FunctionNameType>(name_type_mask); module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok, - inlines_ok, append, *sb_sc_list); + inlines_ok, *sb_sc_list); } return LLDB_RECORD_RESULT(sb_sc_list); } @@ -418,9 +417,9 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name, ModuleSP module_sp(GetSP()); if (name && module_sp) { VariableList variable_list; - const uint32_t match_count = module_sp->FindGlobalVariables( - ConstString(name), nullptr, max_matches, variable_list); - + module_sp->FindGlobalVariables(ConstString(name), nullptr, max_matches, + variable_list); + const uint32_t match_count = variable_list.GetSize(); if (match_count > 0) { for (uint32_t i = 0; i < match_count; ++i) { lldb::ValueObjectSP valobj_sp; |