[Lldb-commits] [lldb] [lldb][ObjC] Consult Objective-C runtime decl vendor when completing type (PR #164011)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 17 14:55:43 PDT 2025
================
@@ -423,6 +423,46 @@ Status ObjCLanguageRuntime::ObjCExceptionPrecondition::ConfigurePrecondition(
return error;
}
+CompilerType ObjCLanguageRuntime::LookupInModulesVendor(ConstString class_name,
+ Target &target) {
+ assert(class_name);
+
+ auto *persistent_state = llvm::cast<ClangPersistentVariables>(
+ target.GetPersistentExpressionStateForLanguage(lldb::eLanguageTypeC));
+ if (!persistent_state)
+ return {};
+
+ auto clang_modules_decl_vendor_sp =
+ persistent_state->GetClangModulesDeclVendor();
+ if (!clang_modules_decl_vendor_sp)
+ return {};
+
+ auto types = clang_modules_decl_vendor_sp->FindTypes(
+ class_name, /*max_matches*/ UINT32_MAX);
----------------
jimingham wrote:
I'm not sure it's the search for UINT32_MAX types that is the problem, but rather the not handling the case where you got more than one type back. If there's more than one, how do you know the first one is the right one?
It's fine to do this as a followup, since this code has been working on the swift fork for a while now. But that's the thing I'd fix, not preemptively ignoring multiple definitions.
https://github.com/llvm/llvm-project/pull/164011
More information about the lldb-commits
mailing list