diff options
author | Shivam Gupta <shivam98.tkg@gmail.com> | 2024-06-15 23:39:58 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-15 23:39:58 +0530 |
commit | ef01c75d467df92b8c659307595aa74ed2290cd8 (patch) | |
tree | 3fb80f9ca946a47cddb3046a168c456e4e0abd51 /lldb | |
parent | e48f211ab8dc4f48cf27a2b08d58eb3fb73460d9 (diff) | |
download | llvm-ef01c75d467df92b8c659307595aa74ed2290cd8.zip llvm-ef01c75d467df92b8c659307595aa74ed2290cd8.tar.gz llvm-ef01c75d467df92b8c659307595aa74ed2290cd8.tar.bz2 |
[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
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Utility/Scalar.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lldb/source/Utility/Scalar.cpp b/lldb/source/Utility/Scalar.cpp index c70c5e1..c680101 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()) { |