forked from OSchip/llvm-project
[lldb/Utility] Delete Scalar::[US]IntValueIsValidForSize
It's unused, and the same functionality is available in llvm (is(U)IntN in MathExtras.h).
This commit is contained in:
parent
93c2a9ae07
commit
e2d24d91c2
|
@ -184,33 +184,6 @@ public:
|
|||
Status SetValueFromData(const DataExtractor &data, lldb::Encoding encoding,
|
||||
size_t byte_size);
|
||||
|
||||
static bool UIntValueIsValidForSize(uint64_t uval64, size_t total_byte_size) {
|
||||
if (total_byte_size > 8)
|
||||
return false;
|
||||
|
||||
if (total_byte_size == 8)
|
||||
return true;
|
||||
|
||||
const uint64_t max = (static_cast<uint64_t>(1)
|
||||
<< static_cast<uint64_t>(total_byte_size * 8)) -
|
||||
1;
|
||||
return uval64 <= max;
|
||||
}
|
||||
|
||||
static bool SIntValueIsValidForSize(int64_t sval64, size_t total_byte_size) {
|
||||
if (total_byte_size > 8)
|
||||
return false;
|
||||
|
||||
if (total_byte_size == 8)
|
||||
return true;
|
||||
|
||||
const int64_t max = (static_cast<int64_t>(1)
|
||||
<< static_cast<uint64_t>(total_byte_size * 8 - 1)) -
|
||||
1;
|
||||
const int64_t min = ~(max);
|
||||
return min <= sval64 && sval64 <= max;
|
||||
}
|
||||
|
||||
protected:
|
||||
Scalar::Type m_type;
|
||||
llvm::APSInt m_integer;
|
||||
|
|
Loading…
Reference in New Issue