|| (MIPS_EABI (gdbarch)
&& (typecode == TYPE_CODE_STRUCT
|| typecode == TYPE_CODE_UNION)
- && TYPE_NFIELDS (arg_type) == 1
- && check_typedef (TYPE_FIELD_TYPE (arg_type, 0))->code ()
+ && arg_type->num_fields () == 1
+ && check_typedef (arg_type->field (0).type ())->code ()
== TYPE_CODE_FLT))
&& MIPS_FPU_TYPE(gdbarch) != MIPS_FPU_NONE);
}
return 1;
else if (typecode == TYPE_CODE_STRUCT)
{
- if (TYPE_NFIELDS (type) < 1)
+ if (type->num_fields () < 1)
return 0;
- return mips_type_needs_double_align (TYPE_FIELD_TYPE (type, 0));
+ return mips_type_needs_double_align (type->field (0).type ());
}
else if (typecode == TYPE_CODE_UNION)
{
int i, n;
- n = TYPE_NFIELDS (type);
+ n = type->num_fields ();
for (i = 0; i < n; i++)
- if (mips_type_needs_double_align (TYPE_FIELD_TYPE (type, i)))
+ if (mips_type_needs_double_align (type->field (i).type ()))
return 1;
return 0;
}
are returned in a floating point register. */
if ((type->code () == TYPE_CODE_STRUCT
|| type->code () == TYPE_CODE_UNION)
- && TYPE_NFIELDS (type) == 1)
+ && type->num_fields () == 1)
{
- struct type *fieldtype = TYPE_FIELD_TYPE (type, 0);
+ struct type *fieldtype = type->field (0).type ();
if (check_typedef (fieldtype)->code () == TYPE_CODE_FLT)
fp_return_type = 1;
if (TYPE_LENGTH (arg_type) < offset + MIPS64_REGSIZE)
return 0;
- for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
+ for (i = 0; i < arg_type->num_fields (); i++)
{
int pos;
struct type *field_type;
/* We're only looking at normal fields. */
- if (field_is_static (&TYPE_FIELD (arg_type, i))
+ if (field_is_static (&arg_type->field (i))
|| (TYPE_FIELD_BITPOS (arg_type, i) % 8) != 0)
continue;
if (pos > offset)
return 0;
- field_type = check_typedef (TYPE_FIELD_TYPE (arg_type, i));
+ field_type = check_typedef (arg_type->field (i).type ());
/* If this field is entirely before the requested offset, go
on to the next one. */
return RETURN_VALUE_REGISTER_CONVENTION;
}
else if (type->code () == TYPE_CODE_STRUCT
- && TYPE_NFIELDS (type) <= 2
- && TYPE_NFIELDS (type) >= 1
- && ((TYPE_NFIELDS (type) == 1
- && (check_typedef (TYPE_FIELD_TYPE (type, 0))->code ()
+ && type->num_fields () <= 2
+ && type->num_fields () >= 1
+ && ((type->num_fields () == 1
+ && (check_typedef (type->field (0).type ())->code ()
== TYPE_CODE_FLT))
- || (TYPE_NFIELDS (type) == 2
- && (check_typedef (TYPE_FIELD_TYPE (type, 0))->code ()
+ || (type->num_fields () == 2
+ && (check_typedef (type->field (0).type ())->code ()
== TYPE_CODE_FLT)
- && (check_typedef (TYPE_FIELD_TYPE (type, 1))->code ()
+ && (check_typedef (type->field (1).type ())->code ()
== TYPE_CODE_FLT))))
{
/* A struct that contains one or two floats. Each value is part
for (field = 0, regnum = (tdep->mips_fpu_type != MIPS_FPU_NONE
? mips_regnum (gdbarch)->fp0
: MIPS_V0_REGNUM);
- field < TYPE_NFIELDS (type); field++, regnum += 2)
+ field < type->num_fields (); field++, regnum += 2)
{
- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ int offset = (FIELD_BITPOS (type->field (field))
/ TARGET_CHAR_BIT);
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
- if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
+ if (TYPE_LENGTH (type->field (field).type ()) == 16)
{
/* A 16-byte long double field goes in two consecutive
registers. */
else
mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch) + regnum,
- TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TYPE_LENGTH (type->field (field).type ()),
gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
}
}
#if 0
else if (type->code () == TYPE_CODE_STRUCT
- && TYPE_NFIELDS (type) <= 2
- && TYPE_NFIELDS (type) >= 1
- && ((TYPE_NFIELDS (type) == 1
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ && type->num_fields () <= 2
+ && type->num_fields () >= 1
+ && ((type->num_fields () == 1
+ && (TYPE_CODE (type->field (0).type ())
== TYPE_CODE_FLT))
- || (TYPE_NFIELDS (type) == 2
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 0))
+ || (type->num_fields () == 2
+ && (TYPE_CODE (type->field (0).type ())
== TYPE_CODE_FLT)
- && (TYPE_CODE (TYPE_FIELD_TYPE (type, 1))
+ && (TYPE_CODE (type->field (1).type ())
== TYPE_CODE_FLT)))
&& tdep->mips_fpu_type != MIPS_FPU_NONE)
{
int regnum;
int field;
for (field = 0, regnum = mips_regnum (gdbarch)->fp0;
- field < TYPE_NFIELDS (type); field++, regnum += 2)
+ field < type->num_fields (); field++, regnum += 2)
{
- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ int offset = (FIELD_BITPOS (type->fields ()[field])
/ TARGET_CHAR_BIT);
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch) + regnum,
- TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
+ TYPE_LENGTH (type->field (field).type ()),
gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
}