diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:17 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:17 -0400 |
commit | 80fc5e77f07557830aaac90723dc599e6d047922 (patch) | |
tree | 2630018f94b5bc23fd160e17468acc7c8675c321 /gdb/dwarf2/read.c | |
parent | 3cabb6b0694b65c7b5ed800822ca08bd899fc1d1 (diff) | |
download | gdb-80fc5e77f07557830aaac90723dc599e6d047922.zip gdb-80fc5e77f07557830aaac90723dc599e6d047922.tar.gz gdb-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/dwarf2/read.c')
-rw-r--r-- | gdb/dwarf2/read.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 08d2358..e6d0811 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9458,7 +9458,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile) field *new_fields = (struct field *) TYPE_ZALLOC (type, ((type->num_fields () + 1) * sizeof (struct field))); - memcpy (new_fields + 1, TYPE_FIELDS (type), + memcpy (new_fields + 1, type->fields (), type->num_fields () * sizeof (struct field)); type->set_fields (new_fields); type->set_num_fields (type->num_fields () + 1); @@ -15002,7 +15002,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, of the method itself (TYPE_CODE_METHOD). */ smash_to_method_type (fnp->type, type, TYPE_TARGET_TYPE (this_type), - TYPE_FIELDS (this_type), + this_type->fields (), this_type->num_fields (), TYPE_VARARGS (this_type)); @@ -15219,7 +15219,7 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile) self_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0)); new_type = alloc_type (objfile); smash_to_method_type (new_type, self_type, TYPE_TARGET_TYPE (pfn_type), - TYPE_FIELDS (pfn_type), pfn_type->num_fields (), + pfn_type->fields (), pfn_type->num_fields (), TYPE_VARARGS (pfn_type)); smash_to_methodptr_type (type, new_type); } @@ -15937,7 +15937,7 @@ update_enumeration_type_from_children (struct die_info *die, type->set_fields ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * fields.size ())); - memcpy (TYPE_FIELDS (type), fields.data (), + memcpy (type->fields (), fields.data (), sizeof (struct field) * fields.size ()); } @@ -16723,7 +16723,7 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu) = alloc_type (cu->per_cu->dwarf2_per_objfile->objfile); smash_to_method_type (new_type, domain, TYPE_TARGET_TYPE (to_type), - TYPE_FIELDS (to_type), to_type->num_fields (), + to_type->fields (), to_type->num_fields (), TYPE_VARARGS (to_type)); type = lookup_methodptr_type (new_type); } |