[Lldb-commits] [lldb] [lldb][NFC] Remove code dupl in favour of a named variable in UnwindAssemblyInstEmulation (PR #169369)
Felipe de Azevedo Piovezan via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 25 02:19:18 PST 2025
https://github.com/felipepiovezan updated https://github.com/llvm/llvm-project/pull/169369
>From 1e4b119c203aa5c703cc355addd5167b4037964b Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Mon, 24 Nov 2025 17:08:31 +0000
Subject: [PATCH 1/2] [lldb][NFC] Remove code dupl in favour of a named
variable in UnwindAssemblyInstEmulation
---
.../InstEmulation/UnwindAssemblyInstEmulation.cpp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index b6b073a96bcad..4da09adba787b 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -212,11 +212,10 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
if (m_curr_row_modified) {
// Save the modified row if we don't already have a CFI row in the
// current address
- if (saved_unwind_states.count(current_offset +
- inst->GetOpcode().GetByteSize()) == 0) {
- m_state.row.SetOffset(current_offset + inst->GetOpcode().GetByteSize());
- saved_unwind_states.emplace(
- current_offset + inst->GetOpcode().GetByteSize(), m_state);
+ auto next_inst_offset = current_offset + inst->GetOpcode().GetByteSize();
+ if (saved_unwind_states.count(next_inst_offset) == 0) {
+ m_state.row.SetOffset(next_inst_offset);
+ saved_unwind_states.emplace(next_inst_offset, m_state);
}
}
}
>From 82f8eba1e6a3189c61b23c8733a39aed73867e5e Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Tue, 25 Nov 2025 10:19:02 +0000
Subject: [PATCH 2/2] fixup! remove auto in favour of guessing the type
---
.../InstEmulation/UnwindAssemblyInstEmulation.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 4da09adba787b..b9d665902dc45 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -212,7 +212,8 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
if (m_curr_row_modified) {
// Save the modified row if we don't already have a CFI row in the
// current address
- auto next_inst_offset = current_offset + inst->GetOpcode().GetByteSize();
+ const lldb::addr_t next_inst_offset =
+ current_offset + inst->GetOpcode().GetByteSize();
if (saved_unwind_states.count(next_inst_offset) == 0) {
m_state.row.SetOffset(next_inst_offset);
saved_unwind_states.emplace(next_inst_offset, m_state);
More information about the lldb-commits
mailing list