daily update
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index b6de34c26ef504936569755bf3aae50352ac6af9..a13847e6b6f082d3d09fa6ce7462362b38e2e714 100644 (file)
@@ -519,6 +519,32 @@ finish_cv_type (struct type *type)
     }
 }
 
+/* Replace the contents of ntype with the type *type.
+
+   This function should not be necessary, but is due to quirks in the stabs
+   reader.  This should go away.  It does not handle the replacement type
+   being cv-qualified; it could be easily fixed to, but it should go away,
+   remember?  */
+void
+replace_type (struct type *ntype, struct type *type)
+{
+  struct type *cv_chain, *as_chain, *ptr, *ref;
+
+  cv_chain = TYPE_CV_TYPE (ntype);
+  as_chain = TYPE_AS_TYPE (ntype);
+  ptr = TYPE_POINTER_TYPE (ntype);
+  ref = TYPE_REFERENCE_TYPE (ntype);
+
+  *ntype = *type;
+
+  TYPE_POINTER_TYPE (ntype) = ptr;
+  TYPE_REFERENCE_TYPE (ntype) = ref;
+  TYPE_CV_TYPE (ntype) = cv_chain;
+  TYPE_AS_TYPE (ntype) = as_chain;
+
+  finish_cv_type (ntype);
+}
+
 /* Implement direct support for MEMBER_TYPE in GNU C++.
    May need to construct such a type if this is the first use.
    The TYPE is the type of the member.  The DOMAIN is the type
@@ -783,7 +809,7 @@ init_simd_type (char *name,
   t = init_type (TYPE_CODE_STRUCT, n * TYPE_LENGTH (elt_type), 0, 0, 0);
   t->nfields = 1;
   t->fields = f;
-  t->tag_name = name;
+  TYPE_TAG_NAME (t) = name;
 
   return t;
 }
@@ -3127,17 +3153,31 @@ build_gdbtypes (void)
     init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
               0,
               "float", (struct objfile *) NULL);
+/* vinschen@redhat.com 2002-02-08:
+   The below lines are disabled since they are doing the wrong
+   thing for non-multiarch targets.  They are setting the correct
+   type of floats for the target but while on multiarch targets
+   this is done everytime the architecture changes, it's done on
+   non-multiarch targets only on startup, leaving the wrong values
+   in even if the architecture changes (eg. from big-endian to
+   little-endian).  */
+#if 0
   TYPE_FLOATFORMAT (builtin_type_float) = TARGET_FLOAT_FORMAT;
+#endif
   builtin_type_double =
     init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "double", (struct objfile *) NULL);
+#if 0
   TYPE_FLOATFORMAT (builtin_type_double) = TARGET_DOUBLE_FORMAT;
+#endif
   builtin_type_long_double =
     init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
               0,
               "long double", (struct objfile *) NULL);
+#if 0
   TYPE_FLOATFORMAT (builtin_type_long_double) = TARGET_LONG_DOUBLE_FORMAT;
+#endif
   builtin_type_complex =
     init_type (TYPE_CODE_COMPLEX, 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
               0,
This page took 0.024354 seconds and 4 git commands to generate.