[Lldb-commits] [lldb] [lldb][NFC] Use unique ptr in AppleObjCRuntime {GetSuperclass, GetMetaclass} (PR #202893)

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 10 02:12:49 PDT 2026


================
@@ -654,37 +654,39 @@ ConstString ClassDescriptorV2::GetClassName() {
   return m_name;
 }
 
-ObjCLanguageRuntime::ClassDescriptorSP ClassDescriptorV2::GetSuperclass() {
+std::unique_ptr<ObjCLanguageRuntime::ClassDescriptor>
+ClassDescriptorV2::GetSuperclass() {
   lldb_private::Process *process = m_runtime.GetProcess();
 
   if (!process)
-    return ObjCLanguageRuntime::ClassDescriptorSP();
+    return nullptr;
 
   auto objc_class = objc_class_t::Read(process, m_objc_class_ptr);
   if (!objc_class) {
     LLDB_LOG_ERROR(GetLog(LLDBLog::Types), objc_class.takeError(), "{0}");
-    return ObjCLanguageRuntime::ClassDescriptorSP();
+    return nullptr;
   }
 
-  return m_runtime.ObjCLanguageRuntime::GetClassDescriptorFromISA(
-      objc_class->m_superclass);
+  return std::unique_ptr<ClassDescriptor>(
+      new ClassDescriptorV2(m_runtime, objc_class->m_superclass, nullptr));
----------------
Teemperor wrote:

Can we actually do that? There is also a subclass `ClassDescriptorV2Tagged` and the original code fetches whatever we have constructed previously. 

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


More information about the lldb-commits mailing list