[Lldb-commits] [lldb] [lldb] Use if-with-initializer pattern in SBTarget (NFC) (PR #141284)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed May 28 00:18:18 PDT 2025
================
@@ -1887,34 +1823,35 @@ lldb::SBTypeList SBTarget::FindTypes(const char *typename_cstr) {
LLDB_INSTRUMENT_VA(this, typename_cstr);
SBTypeList sb_type_list;
- TargetSP target_sp(GetSP());
- if (typename_cstr && typename_cstr[0] && target_sp) {
- ModuleList &images = target_sp->GetImages();
- ConstString const_typename(typename_cstr);
- TypeQuery query(typename_cstr);
- TypeResults results;
- images.FindTypes(nullptr, query, results);
- for (const TypeSP &type_sp : results.GetTypeMap().Types())
- sb_type_list.Append(SBType(type_sp));
-
- // Try the loaded language runtimes
- if (auto process_sp = target_sp->GetProcessSP()) {
- for (auto *runtime : process_sp->GetLanguageRuntimes()) {
- if (auto *vendor = runtime->GetDeclVendor()) {
- auto types =
- vendor->FindTypes(const_typename, /*max_matches*/ UINT32_MAX);
- for (auto type : types)
- sb_type_list.Append(SBType(type));
+ if (TargetSP target_sp = GetSP()) {
----------------
labath wrote:
h
https://github.com/llvm/llvm-project/pull/141284
More information about the lldb-commits
mailing list