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;