Skip to content

Commit e2d24d9

Browse files
committed
[lldb/Utility] Delete Scalar::[US]IntValueIsValidForSize
It's unused, and the same functionality is available in llvm (is(U)IntN in MathExtras.h).
1 parent 93c2a9a commit e2d24d9

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

lldb/include/lldb/Utility/Scalar.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -184,33 +184,6 @@ class Scalar {
184184
Status SetValueFromData(const DataExtractor &data, lldb::Encoding encoding,
185185
size_t byte_size);
186186

187-
static bool UIntValueIsValidForSize(uint64_t uval64, size_t total_byte_size) {
188-
if (total_byte_size > 8)
189-
return false;
190-
191-
if (total_byte_size == 8)
192-
return true;
193-
194-
const uint64_t max = (static_cast<uint64_t>(1)
195-
<< static_cast<uint64_t>(total_byte_size * 8)) -
196-
1;
197-
return uval64 <= max;
198-
}
199-
200-
static bool SIntValueIsValidForSize(int64_t sval64, size_t total_byte_size) {
201-
if (total_byte_size > 8)
202-
return false;
203-
204-
if (total_byte_size == 8)
205-
return true;
206-
207-
const int64_t max = (static_cast<int64_t>(1)
208-
<< static_cast<uint64_t>(total_byte_size * 8 - 1)) -
209-
1;
210-
const int64_t min = ~(max);
211-
return min <= sval64 && sval64 <= max;
212-
}
213-
214187
protected:
215188
Scalar::Type m_type;
216189
llvm::APSInt m_integer;

0 commit comments

Comments
 (0)