[Lldb-commits] [lldb] e2d24d9 - [lldb/Utility] Delete Scalar::[US]IntValueIsValidForSize

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 4 07:28:53 PST 2020


Author: Pavel Labath
Date: 2020-11-04T16:28:10+01:00
New Revision: e2d24d91c2a11ea488844d20ef5fabd05936a668

URL: https://github.com/llvm/llvm-project/commit/e2d24d91c2a11ea488844d20ef5fabd05936a668
DIFF: https://github.com/llvm/llvm-project/commit/e2d24d91c2a11ea488844d20ef5fabd05936a668.diff

LOG: [lldb/Utility] Delete Scalar::[US]IntValueIsValidForSize

It's unused, and the same functionality is available in llvm (is(U)IntN
in MathExtras.h).

Added: 
    

Modified: 
    lldb/include/lldb/Utility/Scalar.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/Scalar.h b/lldb/include/lldb/Utility/Scalar.h
index 7403fd1d9717..09d0f641e4d1 100644
--- a/lldb/include/lldb/Utility/Scalar.h
+++ b/lldb/include/lldb/Utility/Scalar.h
@@ -184,33 +184,6 @@ class Scalar {
   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;


        


More information about the lldb-commits mailing list