summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-10-01 15:40:41 +0000
committerAdrian Prantl <aprantl@apple.com>2019-10-01 15:40:41 +0000
commitbf9d84c0149b4944d58a00024c8abd98eefc9589 (patch)
treef9d2d3252890e476cbccc4870157536bae355f1c /lldb/source/API/SBModule.cpp
parent3c912c4abe2bb962c7bddcf52fab6c65bc5899d5 (diff)
downloadbcm5719-llvm-bf9d84c0149b4944d58a00024c8abd98eefc9589.tar.gz
bcm5719-llvm-bf9d84c0149b4944d58a00024c8abd98eefc9589.zip
Remove size_t return parameter from FindTypes
In r368345 I accidentally introduced a regression that would over-report the number of matches found by FindTypes if the DeclContext Filter was hit. This patch simply removes the size_t return parameter altogether — it's not that useful. rdar://problem/55500457 Differential Revision: https://reviews.llvm.org/D68169 llvm-svn: 373344
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 253a5393486..5eb0f54bed6 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -503,16 +503,10 @@ lldb::SBTypeList SBModule::FindTypes(const char *type) {
const bool exact_match = false;
ConstString name(type);
llvm::DenseSet<SymbolFile *> searched_symbol_files;
- const uint32_t num_matches = module_sp->FindTypes(
- name, exact_match, UINT32_MAX, searched_symbol_files, type_list);
+ module_sp->FindTypes(name, exact_match, UINT32_MAX, searched_symbol_files,
+ type_list);
- if (num_matches > 0) {
- for (size_t idx = 0; idx < num_matches; idx++) {
- TypeSP type_sp(type_list.GetTypeAtIndex(idx));
- if (type_sp)
- retval.Append(SBType(type_sp));
- }
- } else {
+ if (type_list.Empty()) {
auto type_system_or_err =
module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
if (auto err = type_system_or_err.takeError()) {
@@ -523,9 +517,14 @@ lldb::SBTypeList SBModule::FindTypes(const char *type) {
if (compiler_type)
retval.Append(SBType(compiler_type));
}
+ } else {
+ for (size_t idx = 0; idx < type_list.GetSize(); idx++) {
+ TypeSP type_sp(type_list.GetTypeAtIndex(idx));
+ if (type_sp)
+ retval.Append(SBType(type_sp));
+ }
}
}
-
return LLDB_RECORD_RESULT(retval);
}
OpenPOWER on IntegriCloud