[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)
Greg Clayton via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 11 11:18:36 PST 2023
================
@@ -1859,17 +1851,11 @@ lldb::SBTypeList SBTarget::FindTypes(const char *typename_cstr) {
if (typename_cstr && typename_cstr[0] && target_sp) {
ModuleList &images = target_sp->GetImages();
ConstString const_typename(typename_cstr);
- bool exact_match = false;
- TypeList type_list;
- llvm::DenseSet<SymbolFile *> searched_symbol_files;
- images.FindTypes(nullptr, const_typename, exact_match, UINT32_MAX,
- searched_symbol_files, type_list);
-
- for (size_t idx = 0; idx < type_list.GetSize(); idx++) {
- TypeSP type_sp(type_list.GetTypeAtIndex(idx));
- if (type_sp)
- sb_type_list.Append(SBType(type_sp));
- }
+ TypeQuery query(typename_cstr);
+ TypeResults results;
+ images.FindTypes(nullptr, query, results);
+ for (const TypeSP &type_sp : results.GetTypeMap().Types())
----------------
clayborg wrote:
I will change `TypeResults::InsertUnique(...)` to not add any invalid TypeSP objects.
https://github.com/llvm/llvm-project/pull/74786
More information about the lldb-commits
mailing list