gdb: remove TYPE_FIELD_TYPE macro

Remove the `TYPE_FIELD_TYPE` macro, changing all the call sites to use
`type::field` and `field::type` directly.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_FIELD_TYPE): Remove.  Change all call sites
	to use type::field and field::type instead.

Change-Id: Ifda6226a25c811cfd334a756a9fbc5c0afdddff3
This commit is contained in:
Simon Marchi 2020-06-08 15:26:20 -04:00
parent b6cdac4b80
commit 940da03e32
62 changed files with 287 additions and 292 deletions

View file

@ -1824,7 +1824,7 @@ do_search_struct_field (const char *name, struct value *arg1, LONGEST offset,
if (t_field_name
&& t_field_name[0] == '\0')
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
struct type *field_type = type->field (i).type ();
if (field_type->code () == TYPE_CODE_UNION
|| field_type->code () == TYPE_CODE_STRUCT)
@ -2223,7 +2223,7 @@ value_struct_elt_bitpos (struct value **argp, int bitpos, struct type *ftype,
{
if (!field_is_static (&t->field (i))
&& bitpos == TYPE_FIELD_BITPOS (t, i)
&& types_equal (ftype, TYPE_FIELD_TYPE (t, i)))
&& types_equal (ftype, t->field (i).type ()))
return value_primitive_field (*argp, 0, i, t);
}
@ -2968,8 +2968,7 @@ find_oload_champ (gdb::array_view<value *> args,
{
type *t = (methods != NULL
? (TYPE_FN_FIELD_ARGS (methods, ix)[jj].type ())
: TYPE_FIELD_TYPE (SYMBOL_TYPE (functions[ix]),
jj));
: SYMBOL_TYPE (functions[ix])->field (jj).type ());
parm_types.push_back (t);
}
}
@ -3206,7 +3205,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
/* Special case: a method taking void. T1 will contain no
non-artificial fields, and T2 will contain TYPE_CODE_VOID. */
if ((t1->num_fields () - start) == 0 && t2->num_fields () == 1
&& TYPE_FIELD_TYPE (t2, 0)->code () == TYPE_CODE_VOID)
&& t2->field (0).type ()->code () == TYPE_CODE_VOID)
return 1;
if ((t1->num_fields () - start) == t2->num_fields ())
@ -3215,8 +3214,8 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
for (i = 0; i < t2->num_fields (); ++i)
{
if (compare_ranks (rank_one_type (TYPE_FIELD_TYPE (t1, start + i),
TYPE_FIELD_TYPE (t2, i), NULL),
if (compare_ranks (rank_one_type (t1->field (start + i).type (),
t2->field (i).type (), NULL),
EXACT_MATCH_BADNESS) != 0)
return 0;
}
@ -3240,7 +3239,7 @@ get_baseclass_offset (struct type *vt, struct type *cls,
{
for (int i = 0; i < TYPE_N_BASECLASSES (vt); i++)
{
struct type *t = TYPE_FIELD_TYPE (vt, i);
struct type *t = vt->field (i).type ();
if (types_equal (t, cls))
{
if (BASETYPE_VIA_VIRTUAL (vt, i))
@ -3311,10 +3310,10 @@ value_struct_elt_for_reference (struct type *domain, int offset,
if (want_address)
return value_from_longest
(lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
(lookup_memberptr_type (t->field (i).type (), domain),
offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
else if (noside != EVAL_NORMAL)
return allocate_value (TYPE_FIELD_TYPE (t, i));
return allocate_value (t->field (i).type ());
else
{
/* Try to evaluate NAME as a qualified name with implicit