From ef01c75d467df92b8c659307595aa74ed2290cd8 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sat, 15 Jun 2024 23:39:58 +0530 Subject: [PATCH] [lldb] Remove dead code block (NFC) (#94775) The check that max_bit_pos == sign_bit_pos conflicts with the check that sign_bit_pos < max_bit_pos in the block surrounding it. Originally found by cppcheck - lldb/source/Utility/Scalar.cpp:756:23: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] Fixes #85985 --- lldb/source/Utility/Scalar.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lldb/source/Utility/Scalar.cpp b/lldb/source/Utility/Scalar.cpp index c70c5e10799187..c680101aa9efa5 100644 --- a/lldb/source/Utility/Scalar.cpp +++ b/lldb/source/Utility/Scalar.cpp @@ -753,9 +753,7 @@ bool Scalar::SignExtend(uint32_t sign_bit_pos) { return false; case Scalar::e_int: - if (max_bit_pos == sign_bit_pos) - return true; - else if (sign_bit_pos < (max_bit_pos - 1)) { + if (sign_bit_pos < (max_bit_pos - 1)) { llvm::APInt sign_bit = llvm::APInt::getSignMask(sign_bit_pos + 1); llvm::APInt bitwize_and = m_integer & sign_bit; if (bitwize_and.getBoolValue()) {