aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:17 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:17 -0400
commit80fc5e77f07557830aaac90723dc599e6d047922 (patch)
tree2630018f94b5bc23fd160e17468acc7c8675c321 /gdb/ada-lang.c
parent3cabb6b0694b65c7b5ed800822ca08bd899fc1d1 (diff)
downloadbinutils-80fc5e77f07557830aaac90723dc599e6d047922.zip
binutils-80fc5e77f07557830aaac90723dc599e6d047922.tar.gz
binutils-80fc5e77f07557830aaac90723dc599e6d047922.tar.bz2
gdb: remove TYPE_FIELDS macro
Remove all uses of the `TYPE_FIELDS` macro. Replace them with either: 1) type::fields, to obtain a pointer to the fields array (same as TYPE_FIELDS yields) 2) type::field, a new convenience method that obtains a reference to one of the type's field by index. It is meant to replace TYPE_FIELDS (type)[idx] with type->field (idx) gdb/ChangeLog: * gdbtypes.h (struct type) <field>: New method. (TYPE_FIELDS): Remove, replace all uses with either type::fields or type::field. Change-Id: I49fba10114417deb502060c6156aa5f7fc62462f
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d4377a1..c99705c 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8242,7 +8242,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
if (branch_type == NULL)
{
for (f = variant_field + 1; f < rtype->num_fields (); f += 1)
- TYPE_FIELDS (rtype)[f - 1] = TYPE_FIELDS (rtype)[f];
+ rtype->field (f - 1) = rtype->field (f);
rtype->set_num_fields (rtype->num_fields () - 1);
}
else
@@ -8355,7 +8355,7 @@ template_to_static_fixed_type (struct type *type0)
field *fields =
((struct field *)
TYPE_ALLOC (type, nfields * sizeof (struct field)));
- memcpy (fields, TYPE_FIELDS (type0),
+ memcpy (fields, type0->fields (),
sizeof (struct field) * nfields);
type->set_fields (fields);
@@ -8407,7 +8407,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
field *fields =
(struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field));
- memcpy (fields, TYPE_FIELDS (type), sizeof (struct field) * nfields);
+ memcpy (fields, type->fields (), sizeof (struct field) * nfields);
rtype->set_fields (fields);
rtype->set_name (ada_type_name (type));
@@ -8427,7 +8427,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
int f;
for (f = variant_field + 1; f < nfields; f += 1)
- TYPE_FIELDS (rtype)[f - 1] = TYPE_FIELDS (rtype)[f];
+ rtype->field (f - 1) = rtype->field (f);
rtype->set_num_fields (rtype->num_fields () - 1);
}
else