* win32-nat.c (psapi_module_handle): Remove static.
[deliverable/binutils-gdb.git] / gdb / value.c
index 5f39bc8054b48dbeff42fa7576da6c810d26e700..e29bab7391f7f289a4037aa15f7a97ebb96b7491 100644 (file)
@@ -34,6 +34,7 @@
 #include "gdb_assert.h"
 #include "regcache.h"
 #include "block.h"
+#include "dfp.h"
 
 /* Prototypes for exported functions. */
 
@@ -1641,6 +1642,27 @@ value_from_double (struct type *type, DOUBLEST num)
   return val;
 }
 
+struct value *
+value_from_decfloat (struct type *expect_type, struct type *type,
+                     gdb_byte decbytes[16])
+{
+  struct value *val = allocate_value (type);
+  int len = TYPE_LENGTH (type);
+
+  if (expect_type)
+    {
+      int expect_len = TYPE_LENGTH (expect_type);
+      char decstr[MAX_DECIMAL_STRING];
+      int real_len;
+
+      decimal_to_string (decbytes, len, decstr);
+      decimal_from_string (decbytes, expect_len, decstr);
+    }
+
+  memcpy (value_contents_raw (val), decbytes, len);
+  return val;
+}
+
 struct value *
 coerce_ref (struct value *arg)
 {
@@ -1681,39 +1703,12 @@ coerce_enum (struct value *arg)
 }
 \f
 
-/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
-   gdbarch_extract_return_value?  GCC_P is true if compiled with gcc and TYPE
-   is the type (which is known to be struct, union or array).
-
-   On most machines, the struct convention is used unless we are
-   using gcc and the type is of a special size.  */
-/* As of about 31 Mar 93, GCC was changed to be compatible with the
-   native compiler.  GCC 2.3.3 was the last release that did it the
-   old way.  Since gcc2_compiled was not changed, we have no
-   way to correctly win in all cases, so we just do the right thing
-   for gcc1 and for gcc2 after this change.  Thus it loses for gcc
-   2.0-2.3.3.  This is somewhat unfortunate, but changing gcc2_compiled
-   would cause more chaos than dealing with some struct returns being
-   handled wrong.  */
-/* NOTE: cagney/2004-06-13: Deleted check for "gcc_p".  GCC 1.x is
-   dead.  */
-
-int
-generic_use_struct_convention (int gcc_p, struct type *value_type)
-{
-  return !(TYPE_LENGTH (value_type) == 1
-          || TYPE_LENGTH (value_type) == 2
-          || TYPE_LENGTH (value_type) == 4
-          || TYPE_LENGTH (value_type) == 8);
-}
-
 /* Return true if the function returning the specified type is using
    the convention of returning structures in memory (passing in the
-   address as a hidden first parameter).  GCC_P is nonzero if compiled
-   with GCC.  */
+   address as a hidden first parameter).  */
 
 int
-using_struct_return (struct type *value_type, int gcc_p)
+using_struct_return (struct type *value_type)
 {
   enum type_code code = TYPE_CODE (value_type);
 
This page took 0.023979 seconds and 4 git commands to generate.