[Lldb-commits] [lldb] [lldb][4/5] Expose vector registers through SBValue (PR #220707)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 9 01:24:39 PDT 2026


================
@@ -207,27 +208,38 @@ ValueObjectRegister::ValueObjectRegister(ExecutionContextScope *exe_scope,
 ValueObjectRegister::~ValueObjectRegister() = default;
 
 CompilerType ValueObjectRegister::GetCompilerTypeImpl() {
-  if (!m_compiler_type.IsValid()) {
-    ExecutionContext exe_ctx(GetExecutionContextRef());
-    if (auto *target = exe_ctx.GetTargetPtr()) {
-      if (auto *exe_module = target->GetExecutableModulePointer()) {
-        auto type_system_or_err =
-            exe_module->GetTypeSystemForLanguage(eLanguageTypeC);
-        if (auto err = type_system_or_err.takeError()) {
-          LLDB_LOG_ERROR(GetLog(LLDBLog::Types), std::move(err),
-                         "Unable to get CompilerType from TypeSystem: {0}");
-        } else {
-          if (auto ts = *type_system_or_err)
-            m_compiler_type = ts->GetBuiltinTypeForEncodingAndBitSize(
-                m_reg_info.encoding, m_reg_info.byte_size * 8);
-        }
-      }
+  ExecutionContext exe_ctx(GetExecutionContextRef());
+  Target *target = exe_ctx.GetTargetPtr();
+  if (target && llvm::isa_and_present<RegisterTypeBuiltin, RegisterTypeVector>(
+                    m_reg_info.register_type)) {
+    CompilerType register_type = target->GetRegisterType(m_reg_info);
+    if (register_type.IsValid())
+      return register_type;
+  }
+
+  if (!m_compiler_type.IsValid() && target) {
----------------
DavidSpickett wrote:

I would early return if m_compiler_type is valid too, but up to you.

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


More information about the lldb-commits mailing list