* bfd-in.h (align_power): Cast constants to bfd_vma type.
[deliverable/binutils-gdb.git] / gdb / hpread.c
index fe3d3438d5fd99c27dc31a25c0f42f49e7e0a28f..4cc5f18c4771e3caf4f8581ac7877786f052b4e8 100644 (file)
@@ -3959,38 +3959,10 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
              /* But mark it as NULL if the method was incompletely processed
                 We'll fix this up later when the method is fully processed */
              if (TYPE_INCOMPLETE (memtype))
-               {
-                 fn_p->field.fn_fields[ix].type = NULL;
-                 fn_p->field.fn_fields[ix].args = NULL;
-               }
+               fn_p->field.fn_fields[ix].type = NULL;
              else
-               {
-                 fn_p->field.fn_fields[ix].type = memtype;
-
-                 /* The argument list */
-                 TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type).arg_types
-                   = (struct type **) obstack_alloc (&objfile->type_obstack,
-                                                     (sizeof (struct type *)
-                                                      * (TYPE_NFIELDS (memtype)
-                                                         + 1)));
-                 for (i = 0; i < TYPE_NFIELDS (memtype); i++)
-                   TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type)
-                     .arg_types[i] = TYPE_FIELDS (memtype)[i].type;
-                 /* void termination */
-                 TYPE_TYPE_SPECIFIC (fn_p->field.fn_fields[ix].type)
-                   .arg_types[TYPE_NFIELDS (memtype)] = builtin_type_void;
-
-                 /* pai: It's not clear why this args field has to be set.  Perhaps
-                  * it should be eliminated entirely. */
-                 fn_p->field.fn_fields[ix].args =
-                   (struct type **) obstack_alloc (&objfile->type_obstack,
-                          sizeof (struct type *) * (TYPE_NFIELDS (memtype) + 1));
-                 for (i = 0; i < TYPE_NFIELDS (memtype); i++)
-                   fn_p->field.fn_fields[ix].args[i]
-                     = TYPE_FIELDS (memtype)[i].type;
-                 /* null-terminated, unlike arg_types above e */
-                 fn_p->field.fn_fields[ix].args[TYPE_NFIELDS (memtype)] = NULL;
-               }
+               fn_p->field.fn_fields[ix].type = memtype;
+
              /* For virtual functions, fill in the voffset field with the
               * virtual table offset. (This is just copied over from the
               * SOM record; not sure if it is what GDB expects here...).
@@ -4066,7 +4038,6 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
              list = new;
 
              list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
-             FIELD_BITSIZE (list->field) = -1;         /* indicates static member */
              SET_FIELD_PHYSNAME (list->field, 0);      /* initialize to empty */
              memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
 
@@ -4403,9 +4374,6 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp,
   /* Clear the global saying what template we are in the middle of processing */
   current_template = NULL;
 
-  /* Fix up any cv-qualified versions of this type.  */
-  finish_cv_type (type);
-
   return type;
 }
 
@@ -4469,24 +4437,6 @@ fixup_class_method_type (struct type *class, struct type *method,
        {
          /* Set the method type */
          TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j) = method;
-         /* The argument list */
-         TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types
-           = (struct type **) obstack_alloc (&objfile->type_obstack,
-                           sizeof (struct type *) * (TYPE_NFIELDS (method) + 1));
-         for (k = 0; k < TYPE_NFIELDS (method); k++)
-           TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types[k] = TYPE_FIELDS (method)[k].type;
-         /* void termination */
-         TYPE_TYPE_SPECIFIC (TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (class, i), j)).arg_types[TYPE_NFIELDS (method)] = builtin_type_void;
-
-         /* pai: It's not clear why this args field has to be set.  Perhaps
-          * it should be eliminated entirely. */
-         (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args
-           = (struct type **) obstack_alloc (&objfile->type_obstack,
-                           sizeof (struct type *) * (TYPE_NFIELDS (method) + 1));
-         for (k = 0; k < TYPE_NFIELDS (method); k++)
-           (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[k] = TYPE_FIELDS (method)[k].type;
-         /* null-terminated, unlike arg_types above */
-         (TYPE_FN_FIELD (TYPE_FN_FIELDLIST1 (class, i), j)).args[TYPE_NFIELDS (method)] = NULL;
 
          /* Break out of both loops -- only one method to fix up in a class */
          goto finish;
@@ -4940,21 +4890,18 @@ hpread_type_lookup (dnttpointer hp_type, struct objfile *objfile)
        struct type *retvaltype;
        int nargs;
        int i;
-       struct type **args_type;
        class_type = hpread_type_lookup (dn_bufp->dptrmem.pointsto,
                                         objfile);
        functype = hpread_type_lookup (dn_bufp->dptrmem.memtype,
                                       objfile);
        retvaltype = TYPE_TARGET_TYPE (functype);
        nargs = TYPE_NFIELDS (functype);
-       args_type = (struct type **) xmalloc ((nargs + 1) * sizeof (struct type *));
-       for (i = 0; i < nargs; i++)
-         {
-           args_type[i] = TYPE_FIELD_TYPE (functype, i);
-         }
-       args_type[nargs] = NULL;
        ptrmemtype = alloc_type (objfile);
-       smash_to_method_type (ptrmemtype, class_type, retvaltype, args_type);
+
+       smash_to_method_type (ptrmemtype, class_type, retvaltype,
+                             TYPE_FIELDS (functype),
+                             TYPE_NFIELDS (functype),
+                             0);
        return make_pointer_type (ptrmemtype, NULL);
       }
       break;
This page took 0.024717 seconds and 4 git commands to generate.