[Lldb-commits] [lldb] [lldb][AArch64][Linux] Add field information for the CPSR register (PR #70300)
    David Spickett via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Wed Nov  8 02:02:36 PST 2023
    
    
  
================
@@ -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
    
    
More information about the lldb-commits
mailing list