================
@@ -437,26 +437,25 @@ lldb::SBType SBModule::FindFirstType(const char
*name_cstr) {
LLDB_INSTRUMENT_VA(this, name_cstr);
ModuleSP module_sp(GetSP());
- if (!name_cstr || !module_sp)
- return {};
- SymbolContext sc;
- const bool exact_match = false;
- ConstString name(name_cstr);
+ if (name_cstr && module_sp) {
+ ConstString name(name_cstr);
+ TypeQuery query(name.GetStringRef(), TypeQueryOptions::e_find_one);
+ TypeResults results;
+ module_sp->FindTypes(query, results);
+ TypeSP type_sp = results.GetFirstType();
+ if (type_sp)
+ return SBType(type_sp);
----------------
Michael137 wrote:
We previously would only return `sb_type` if `sb_type.IsValid() == true`. Does
this mean we can now return an "invalid" SBType? Or is this checked elsewhere
now?
https://github.com/llvm/llvm-project/pull/74786
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits