[Lldb-commits] [PATCH] D111435: [lldb] [DynamicRegisterInfo] Support setting from vector<Register>

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 11 03:41:17 PDT 2021


labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lldb/source/Target/DynamicRegisterInfo.cpp:394-395
+
+    for (uint32_t value_reg : reg.value_regs)
+      m_value_regs_map[local_regnum].push_back(value_reg);
+    for (uint32_t invalidate_reg : reg.invalidate_regs)
----------------
`m_value_regs_map[local_regnum] = reg.value_regs` ?

Since I think the callers have no used for the input vector after this call, you might even try to take it by rvalue reference and then move these subvectors in place


================
Comment at: lldb/unittests/Target/DynamicRegisterInfoTest.cpp:176-178
+    EXPECT_NE(reg, nullptr);
+    if (!reg)
+      return;
----------------
ASSERT_NE(reg, nullptr);


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111435/new/

https://reviews.llvm.org/D111435



More information about the lldb-commits mailing list