[Lldb-commits] [lldb] 74c9168 - [lldb][nfc] Avoid duplicate calls to GetInstructionCondition in UnwindAssemblyInstEmulation (#168340)

via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 17 03:58:47 PST 2025


Author: Felipe de Azevedo Piovezan
Date: 2025-11-17T11:58:43Z
New Revision: 74c91680e6c9e68c9915ac10eb95c2fe31fd5651

URL: https://github.com/llvm/llvm-project/commit/74c91680e6c9e68c9915ac10eb95c2fe31fd5651
DIFF: https://github.com/llvm/llvm-project/commit/74c91680e6c9e68c9915ac10eb95c2fe31fd5651.diff

LOG: [lldb][nfc] Avoid duplicate calls to GetInstructionCondition in UnwindAssemblyInstEmulation (#168340)

Added: 
    

Modified: 
    lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 790f230af74c9..8437a51471ca2 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -174,8 +174,10 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
 
     m_inst_emulator_up->SetInstruction(inst->GetOpcode(), inst->GetAddress(),
                                        nullptr);
+    const EmulateInstruction::InstructionCondition new_condition =
+        m_inst_emulator_up->GetInstructionCondition();
 
-    if (last_condition != m_inst_emulator_up->GetInstructionCondition()) {
+    if (last_condition != new_condition) {
       // If the last instruction was conditional with a 
diff erent condition
       // than the current condition then restore the state.
       if (last_condition != EmulateInstruction::UnconditionalCondition) {
@@ -190,7 +192,7 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
       condition_block_start_state = it;
     }
 
-    last_condition = m_inst_emulator_up->GetInstructionCondition();
+    last_condition = new_condition;
 
     m_inst_emulator_up->EvaluateInstruction(
         eEmulateInstructionOptionIgnoreConditions);


        


More information about the lldb-commits mailing list