================
@@ -62,7 +62,10 @@ struct RegisterInfo {
   /// rax ax, ah, and al.
   uint32_t *invalidate_regs;
   /// If not nullptr, a type defined by XML descriptions.
-  const RegisterFlags *flags_type;
+  /// This is mutable so that it may be updated after the register info tables
+  /// have been constructed. For example a specific target OS may have a
+  /// different layout.
+  mutable const RegisterFlags *flags_type;
----------------
DavidSpickett wrote:

Actually it's not that, it's that `RegsterInfo's are const elsewhere in lldb. 
So mutable allows us to update `flags_type` even in that scenario.

Which is a code smell but I don't want to unpick all the const-ness elsewhere. 
Just trust that we will not mutate this while someone else is trying to use it.

https://github.com/llvm/llvm-project/pull/70300
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to