[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 04:46:13 PST 2023


================
@@ -502,11 +499,8 @@ lldb::SBTypeList SBModule::FindTypes(const char *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));
-      }
+      for (const TypeSP &type_sp : results.GetTypeMap().Types())
+        retval.Append(SBType(type_sp));
----------------
Michael137 wrote:

Should we add a debug-assert here (or maybe in `InsertUnique`) that tests `type_sp != nullptr`?

https://github.com/llvm/llvm-project/pull/74786


More information about the lldb-commits mailing list