gdb: remove TYPE_FIELD_NAME and FIELD_NAME macros

Remove the `TYPE_FIELD_NAME` and `FIELD_NAME` macros, changing all the
call sites to use field::name directly.

Change-Id: I6900ae4e1ffab1396e24fb3298e94bf123826ca6
This commit is contained in:
Simon Marchi 2021-08-30 11:49:49 -04:00
parent d3fd12dfc5
commit 33d16dd987
34 changed files with 155 additions and 158 deletions

View file

@ -326,7 +326,7 @@ print_enum_type (struct type *type, struct ui_file *stream)
if (i)
fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_styled (ada_enum_name (TYPE_FIELD_NAME (type, i)),
fputs_styled (ada_enum_name (type->field (i).name ()),
variable_name_style.style (), stream);
if (lastval != TYPE_FIELD_ENUMVAL (type, i))
{
@ -439,7 +439,7 @@ print_choices (struct type *type, int field_num, struct ui_file *stream,
{
int have_output;
int p;
const char *name = TYPE_FIELD_NAME (type, field_num);
const char *name = type->field (field_num).name ();
have_output = 0;
@ -620,7 +620,7 @@ print_selected_record_field_types (struct type *type, struct type *outer_type,
flds += 1;
fprintf_filtered (stream, "\n%*s", level + 4, "");
ada_print_type (type->field (i).type (),
TYPE_FIELD_NAME (type, i),
type->field (i).name (),
stream, show - 1, level + 4, flags);
fprintf_filtered (stream, ";");
}
@ -682,7 +682,7 @@ print_variant_part (const variant_part &part,
name = "?";
else
{
name = TYPE_FIELD_NAME (type, part.discriminant_index);
name = type->field (part.discriminant_index).name ();;
discr_type = type->field (part.discriminant_index).type ();
}
@ -851,7 +851,7 @@ print_unchecked_union_type (struct type *type, struct ui_file *stream,
fprintf_filtered (stream, "\n%*swhen ? =>\n%*s", level + 8, "",
level + 12, "");
ada_print_type (type->field (i).type (),
TYPE_FIELD_NAME (type, i),
type->field (i).name (),
stream, show - 1, level + 12, flags);
fprintf_filtered (stream, ";");
}