gdb: remove TYPE_FIELD macro

Replace all uses of it by type::field.

Note that since type::field returns a reference to the field, some spots
are used to assign the whole field structure.  See ctfread.c, function
attach_fields_to_type, for example.  This is the same as was happening
with the macro, so I don't think it's a problem, but if anybody sees a
really nicer way to do this, now could be a good time to implement it.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_FIELD): Remove.  Replace all uses with
	type::field.
This commit is contained in:
Simon Marchi
2020-05-23 17:39:54 -04:00
parent 26f1625454
commit ceacbf6edf
31 changed files with 84 additions and 81 deletions

View File

@@ -191,7 +191,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
/* If requested, skip printing of static fields. */
if (!options->static_field_print
&& field_is_static (&TYPE_FIELD (type, i)))
&& field_is_static (&type->field (i)))
continue;
if (fields_seen)
@@ -225,7 +225,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
if (field_is_static (&TYPE_FIELD (type, i)))
if (field_is_static (&type->field (i)))
{
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream,
@@ -256,7 +256,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
}
annotate_field_value ();
if (!field_is_static (&TYPE_FIELD (type, i))
if (!field_is_static (&type->field (i))
&& TYPE_FIELD_PACKED (type, i))
{
struct value *v;
@@ -295,7 +295,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
else if (field_is_static (&TYPE_FIELD (type, i)))
else if (field_is_static (&type->field (i)))
{
try
{