================
@@ -5392,20 +5409,22 @@ bool ParseRegisters(
 
         if (!gdb_type.empty()) {
           // gdb_type could reference some flags type defined in XML.
-          llvm::StringMap<std::unique_ptr<RegisterTypeFlags>>::iterator it =
-              registers_flags_types.find(gdb_type);
-          if (it != registers_flags_types.end()) {
-            auto flags_type = it->second.get();
-            if (reg_info.byte_size == flags_type->GetSize())
-              reg_info.register_type = flags_type;
-            else
-              LLDB_LOG(
-                  log,
-                  "ProcessGDBRemote::ParseRegisters Size of register flags {0} 
"
-                  "({1} bytes) for register {2} does not match the register "
-                  "size ({3} bytes). Ignoring this set of flags.",
-                  flags_type->GetID().c_str(), flags_type->GetSize(),
-                  reg_info.name, reg_info.byte_size);
+          auto it = register_types.find(gdb_type);
+          if (it != register_types.end()) {
+            const auto *flags_type =
+                llvm::dyn_cast<RegisterTypeFlags>(it->second);
+            if (flags_type) {
----------------
DavidSpickett wrote:

You can `if(const auto *flags_type = ...)`.

https://github.com/llvm/llvm-project/pull/216384
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to