[Lldb-commits] [lldb] Make only one function that needs to be implemented when searching for types (PR #74786)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 11 06:27:37 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())
----------------
Michael137 wrote:
Should we add a debug-assert here (or maybe in `InsertUnique`) that tests `type_sp != nullptr`? Or are we guaranteed somewhere that these won't be `nullptr`?
https://github.com/llvm/llvm-project/pull/74786
More information about the lldb-commits
mailing list