[Lldb-commits] [lldb] [lldb] Cache register types by object UID and register size (PR #215874)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 13 03:23:08 PDT 2026


================
@@ -33,15 +33,33 @@ class RegisterTypeBuilderClang : public RegisterTypeBuilder {
   CompilerType GetRegisterType(const RegisterInfo &reg_info) override;
 
 private:
-  CompilerType BuildEnumType(const RegisterTypeEnum &enum_type_info,
+  CompilerType BuildEnumType(const RegisterTypeEnum *enum_type_info,
                              uint32_t register_byte_size,
                              lldb::TypeSystemClangSP type_system);
 
-  CompilerType BuildFlagsType(const RegisterTypeFlags &flags_info,
+  CompilerType BuildFlagsType(const RegisterTypeFlags *flags_info,
                               uint32_t register_byte_size,
                               lldb::TypeSystemClangSP type_system);
 
   Target &m_target;
+
+  // A cache of previously created types. We do not cache by element ID because
+  // IDs are not unique across xml <feature> elements and this class does not
+  // know anything about features.
+  //
+  // The key contains the lifetime-unique ID of the type and the size of the
----------------
DavidSpickett wrote:

Lifetime of what specifically?

Of type RegisterType, or of "lifetime of this debugger process." as stated earlier?

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


More information about the lldb-commits mailing list