[Lldb-commits] [lldb] r289647 - Replace APFloatBase static fltSemantics data members with getter functions

Stephan Bergmann via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 14 03:57:21 PST 2016


Author: sberg
Date: Wed Dec 14 05:57:17 2016
New Revision: 289647

URL: http://llvm.org/viewvc/llvm-project?rev=289647&view=rev
Log:
Replace APFloatBase static fltSemantics data members with getter functions

At least the plugin used by the LibreOffice build
(<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly
uses those members (through inline functions in LLVM/Clang include files in turn
using them), but they are not exported by utils/extract_symbols.py on Windows,
and accessing data across DLL/EXE boundaries on Windows is generally
problematic.

Differential Revision: https://reviews.llvm.org/D26671

Modified:
    lldb/trunk/include/lldb/Core/Scalar.h
    lldb/trunk/source/Core/Scalar.cpp

Modified: lldb/trunk/include/lldb/Core/Scalar.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Scalar.h?rev=289647&r1=289646&r2=289647&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Scalar.h (original)
+++ lldb/trunk/include/lldb/Core/Scalar.h Wed Dec 14 05:57:17 2016
@@ -75,11 +75,11 @@ public:
   Scalar(long double v, bool ieee_quad)
       : m_type(e_long_double), m_float((float)0), m_ieee_quad(ieee_quad) {
     if (ieee_quad)
-      m_float = llvm::APFloat(llvm::APFloat::IEEEquad,
+      m_float = llvm::APFloat(llvm::APFloat::IEEEquad(),
                               llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,
                                           ((type128 *)&v)->x));
     else
-      m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+      m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                               llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,
                                           ((type128 *)&v)->x));
   }

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=289647&r1=289646&r2=289647&view=diff
==============================================================================
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Wed Dec 14 05:57:17 2016
@@ -403,11 +403,11 @@ Scalar &Scalar::operator=(long double v)
   m_type = e_long_double;
   if (m_ieee_quad)
     m_float = llvm::APFloat(
-        llvm::APFloat::IEEEquad,
+        llvm::APFloat::IEEEquad(),
         llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128, ((type128 *)&v)->x));
   else
     m_float = llvm::APFloat(
-        llvm::APFloat::x87DoubleExtended,
+        llvm::APFloat::x87DoubleExtended(),
         llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128, ((type128 *)&v)->x));
   return *this;
 }
@@ -509,9 +509,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -569,9 +569,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -625,9 +625,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -677,9 +677,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -725,9 +725,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -769,9 +769,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -813,9 +813,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -853,9 +853,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -893,9 +893,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -929,9 +929,9 @@ bool Scalar::Promote(Scalar::Type type)
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -962,9 +962,9 @@ bool Scalar::Promote(Scalar::Type type)
     case e_long_double:
       if (m_ieee_quad)
         m_float =
-            llvm::APFloat(llvm::APFloat::IEEEquad, m_float.bitcastToAPInt());
+            llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                                 m_float.bitcastToAPInt());
       success = true;
       break;
@@ -992,9 +992,9 @@ bool Scalar::Promote(Scalar::Type type)
     case e_long_double:
       if (m_ieee_quad)
         m_float =
-            llvm::APFloat(llvm::APFloat::IEEEquad, m_float.bitcastToAPInt());
+            llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                                 m_float.bitcastToAPInt());
       success = true;
       break;
@@ -1176,9 +1176,9 @@ bool Scalar::Cast(Scalar::Type type) {
 
     case e_long_double:
       if (m_ieee_quad)
-        m_float = llvm::APFloat(llvm::APFloat::IEEEquad, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended, m_integer);
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
       success = true;
       break;
     }
@@ -1212,9 +1212,9 @@ bool Scalar::Cast(Scalar::Type type) {
     case e_long_double:
       if (m_ieee_quad)
         m_float =
-            llvm::APFloat(llvm::APFloat::IEEEquad, m_float.bitcastToAPInt());
+            llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                                 m_float.bitcastToAPInt());
       success = true;
       break;
@@ -1249,9 +1249,9 @@ bool Scalar::Cast(Scalar::Type type) {
     case e_long_double:
       if (m_ieee_quad)
         m_float =
-            llvm::APFloat(llvm::APFloat::IEEEquad, m_float.bitcastToAPInt());
+            llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
       else
-        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+        m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                                 m_float.bitcastToAPInt());
       success = true;
       break;
@@ -2579,7 +2579,7 @@ Error Scalar::SetValueFromCString(const
     } else if (byte_size == sizeof(long double)) {
       if (::sscanf(value_str, "%Lf", &l_val) == 1) {
         m_float =
-            llvm::APFloat(llvm::APFloat::x87DoubleExtended,
+            llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
                           llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,
                                       ((type128 *)&l_val)->x));
         m_type = e_long_double;




More information about the lldb-commits mailing list