diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp index 458b996d6ff62..10aefc6d9dc08 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp @@ -191,8 +191,7 @@ static InstrPattern PATTERNS[] = { bool EmulateInstructionRISCV::DecodeAndExecute(uint32_t inst, bool ignore_cond) { Log *log = GetLog(LLDBLog::Process | LLDBLog::Breakpoints); - for (int i = 0; i < llvm::array_lengthof(PATTERNS); ++i) { - const InstrPattern &pat = PATTERNS[i]; + for (const InstrPattern &pat : PATTERNS) { if ((inst & pat.type_mask) == pat.eigen) { LLDB_LOGF(log, "EmulateInstructionRISCV::%s: inst(%x) was decoded to %s", __FUNCTION__, inst, pat.name); diff --git a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h index 6df9a7d409a75..39f7c429106bc 100644 --- a/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h +++ b/lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.h @@ -31,7 +31,6 @@ class EmulateInstructionRISCV : public EmulateInstruction { return true; case eInstructionTypePrologueEpilogue: case eInstructionTypeAll: - default: return false; } }