mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
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:
@@ -182,7 +182,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch)
|
||||
= (struct type *) gdbarch_data (gdbarch, vtable_type_gdbarch_data);
|
||||
|
||||
/* The "offset_to_top" field has the appropriate (ptrdiff_t) type. */
|
||||
return TYPE_FIELD_TYPE (vtable_type, vtable_field_offset_to_top);
|
||||
return vtable_type->field (vtable_field_offset_to_top).type ();
|
||||
}
|
||||
|
||||
/* Return the offset from the start of the imaginary `struct
|
||||
@@ -221,7 +221,7 @@ gnuv3_dynamic_class (struct type *type)
|
||||
|
||||
for (fieldnum = 0; fieldnum < TYPE_N_BASECLASSES (type); fieldnum++)
|
||||
if (BASETYPE_VIA_VIRTUAL (type, fieldnum)
|
||||
|| gnuv3_dynamic_class (TYPE_FIELD_TYPE (type, fieldnum)))
|
||||
|| gnuv3_dynamic_class (type->field (fieldnum).type ()))
|
||||
{
|
||||
TYPE_CPLUS_DYNAMIC (type) = 1;
|
||||
return 1;
|
||||
@@ -467,7 +467,7 @@ gnuv3_baseclass_offset (struct type *type, int index,
|
||||
{
|
||||
struct dwarf2_property_baton baton;
|
||||
baton.property_type
|
||||
= lookup_pointer_type (TYPE_FIELD_TYPE (type, index));
|
||||
= lookup_pointer_type (type->field (index).type ());
|
||||
baton.locexpr = *TYPE_FIELD_DWARF_BLOCK (type, index);
|
||||
|
||||
struct dynamic_prop prop;
|
||||
@@ -550,7 +550,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset,
|
||||
continue;
|
||||
|
||||
pos = TYPE_BASECLASS_BITPOS (domain, i) / 8;
|
||||
basetype = TYPE_FIELD_TYPE (domain, i);
|
||||
basetype = domain->field (i).type ();
|
||||
/* Recurse with a modified adjustment. We don't need to adjust
|
||||
voffset. */
|
||||
if (adjustment >= pos && adjustment < pos + TYPE_LENGTH (basetype))
|
||||
@@ -1331,7 +1331,7 @@ is_copy_or_move_constructor_type (struct type *class_type,
|
||||
|
||||
/* ...and the second argument should be the same as the class
|
||||
type, with the expected type code... */
|
||||
struct type *arg_type = TYPE_FIELD_TYPE (method_type, 1);
|
||||
struct type *arg_type = method_type->field (1).type ();
|
||||
|
||||
if (arg_type->code () != expected)
|
||||
return false;
|
||||
@@ -1345,7 +1345,7 @@ is_copy_or_move_constructor_type (struct type *class_type,
|
||||
constructor. */
|
||||
for (int i = 2; i < method_type->num_fields (); i++)
|
||||
{
|
||||
arg_type = TYPE_FIELD_TYPE (method_type, i);
|
||||
arg_type = method_type->field (i).type ();
|
||||
/* FIXME aktemur/2019-10-31: As of this date, neither
|
||||
clang++-7.0.0 nor g++-8.2.0 produce a DW_AT_default_value
|
||||
attribute. GDB is also not set to read this attribute, yet.
|
||||
@@ -1529,7 +1529,7 @@ gnuv3_pass_by_reference (struct type *type)
|
||||
for (fieldnum = 0; fieldnum < type->num_fields (); fieldnum++)
|
||||
if (!field_is_static (&type->field (fieldnum)))
|
||||
{
|
||||
struct type *field_type = TYPE_FIELD_TYPE (type, fieldnum);
|
||||
struct type *field_type = type->field (fieldnum).type ();
|
||||
|
||||
/* For arrays, make the decision based on the element type. */
|
||||
if (field_type->code () == TYPE_CODE_ARRAY)
|
||||
|
||||
Reference in New Issue
Block a user