[Lldb-commits] [lldb] 2e828e7 - [lldb] Fix e89414f406 for msvc

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 27 02:49:55 PDT 2020


Author: Pavel Labath
Date: 2020-07-27T11:49:46+02:00
New Revision: 2e828e7579928e8cc1c5e53c84ab99ffb5afca03

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

LOG: [lldb] Fix e89414f406 for msvc

MSVC finds the APInt construction ambiguous. Use a case to help it
choose the right constructor.

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 1dbcf80bfd89..45ba7c012229 100644
--- a/lldb/include/lldb/Utility/Scalar.h
+++ b/lldb/include/lldb/Utility/Scalar.h
@@ -62,18 +62,23 @@ class Scalar {
   // Constructors and Destructors
   Scalar() : m_type(e_void), m_float(0.0f) {}
   Scalar(int v)
-      : m_type(e_sint), m_integer(sizeof(v) * 8, v, true), m_float(0.0f) {}
+      : m_type(e_sint), m_integer(sizeof(v) * 8, uint64_t(v), true),
+        m_float(0.0f) {}
   Scalar(unsigned int v)
-      : m_type(e_uint), m_integer(sizeof(v) * 8, v, false), m_float(0.0f) {}
+      : m_type(e_uint), m_integer(sizeof(v) * 8, uint64_t(v), false),
+        m_float(0.0f) {}
   Scalar(long v)
-      : m_type(e_slong), m_integer(sizeof(v) * 8, v, true), m_float(0.0f) {}
+      : m_type(e_slong), m_integer(sizeof(v) * 8, uint64_t(v), true),
+        m_float(0.0f) {}
   Scalar(unsigned long v)
-      : m_type(e_ulong), m_integer(sizeof(v) * 8, v, false), m_float(0.0f) {}
+      : m_type(e_ulong), m_integer(sizeof(v) * 8, uint64_t(v), false),
+        m_float(0.0f) {}
   Scalar(long long v)
-      : m_type(e_slonglong), m_integer(sizeof(v) * 8, v, true), m_float(0.0f) {}
+      : m_type(e_slonglong), m_integer(sizeof(v) * 8, uint64_t(v), true),
+        m_float(0.0f) {}
   Scalar(unsigned long long v)
-      : m_type(e_ulonglong), m_integer(sizeof(v) * 8, v, false), m_float(0.0f) {
-  }
+      : m_type(e_ulonglong), m_integer(sizeof(v) * 8, uint64_t(v), false),
+        m_float(0.0f) {}
   Scalar(float v) : m_type(e_float), m_float(v) {}
   Scalar(double v) : m_type(e_double), m_float(v) {}
   Scalar(long double v) : m_type(e_long_double), m_float(double(v)) {


        


More information about the lldb-commits mailing list