baloghadamsoftware created this revision. baloghadamsoftware added a reviewer: clayborg. baloghadamsoftware added a project: LLDB. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs, kbarton, kristof.beyls, nemanjai.
Condition `auto_advance_pc` is checked both in an outer and in an inner `if` statement in `EmulateInstructionARM::EvaluateInstruction()`, `EmulateInstructionARM64::EvaluateInstruction()` and `EmulateInstructionPPC64::EvaluateInstruction()`. This patch removes the redundant inner check. The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82558 Files: lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp Index: lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp =================================================================== --- lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp +++ lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp @@ -198,7 +198,7 @@ if (!success) return false; - if (auto_advance_pc && (new_pc_value == orig_pc_value)) { + if (new_pc_value == orig_pc_value) { EmulateInstruction::Context context; context.type = eContextAdvancePC; context.SetNoArgs(); Index: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -433,7 +433,7 @@ if (!success) return false; - if (auto_advance_pc && (new_pc_value == orig_pc_value)) { + if (new_pc_value == orig_pc_value) { EmulateInstruction::Context context; context.type = eContextAdvancePC; context.SetNoArgs(); Index: lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -14361,7 +14361,7 @@ if (!success) return false; - if (auto_advance_pc && (after_pc_value == orig_pc_value)) { + if (after_pc_value == orig_pc_value) { after_pc_value += m_opcode.GetByteSize(); EmulateInstruction::Context context;
Index: lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp =================================================================== --- lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp +++ lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp @@ -198,7 +198,7 @@ if (!success) return false; - if (auto_advance_pc && (new_pc_value == orig_pc_value)) { + if (new_pc_value == orig_pc_value) { EmulateInstruction::Context context; context.type = eContextAdvancePC; context.SetNoArgs(); Index: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -433,7 +433,7 @@ if (!success) return false; - if (auto_advance_pc && (new_pc_value == orig_pc_value)) { + if (new_pc_value == orig_pc_value) { EmulateInstruction::Context context; context.type = eContextAdvancePC; context.SetNoArgs(); Index: lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp =================================================================== --- lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -14361,7 +14361,7 @@ if (!success) return false; - if (auto_advance_pc && (after_pc_value == orig_pc_value)) { + if (after_pc_value == orig_pc_value) { after_pc_value += m_opcode.GetByteSize(); EmulateInstruction::Context context;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits