[lldb/Utility] Delete Scalar::[US]IntValueIsValidForSize
authorPavel Labath <pavel@labath.sk>
Wed, 4 Nov 2020 14:13:44 +0000 (15:13 +0100)
committerPavel Labath <pavel@labath.sk>
Wed, 4 Nov 2020 15:28:10 +0000 (16:28 +0100)
It's unused, and the same functionality is available in llvm (is(U)IntN
in MathExtras.h).

lldb/include/lldb/Utility/Scalar.h

index 7403fd1..09d0f64 100644 (file)
@@ -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;