Replace field_is_static with a method

This changes field_is_static to be a method on struct field, and
updates all the callers.  Most of this patch was written by script.

Regression tested on x86-64 Fedora 36.
This commit is contained in:
Tom Tromey
2023-04-22 12:41:43 -06:00
parent 077a1f0848
commit c819a3380f
24 changed files with 55 additions and 57 deletions

View File

@@ -130,7 +130,7 @@ rust_underscore_fields (struct type *type)
return false;
for (i = 0; i < type->num_fields (); ++i)
{
if (!field_is_static (&type->field (i)))
if (!type->field (i).is_static ())
{
char buf[20];
@@ -403,7 +403,7 @@ rust_language::val_print_struct
first_field = 1;
for (i = 0; i < type->num_fields (); ++i)
{
if (field_is_static (&type->field (i)))
if (type->field (i).is_static ())
continue;
if (!first_field)
@@ -723,7 +723,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
std::vector<int> fields;
for (int i = 0; i < type->num_fields (); ++i)
{
if (field_is_static (&type->field (i)))
if (type->field (i).is_static ())
continue;
if (is_enum && TYPE_FIELD_ARTIFICIAL (type, i))
continue;
@@ -741,7 +741,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
{
QUIT;
gdb_assert (!field_is_static (&type->field (i)));
gdb_assert (!type->field (i).is_static ());
gdb_assert (! (is_enum && TYPE_FIELD_ARTIFICIAL (type, i)));
if (flags->print_offsets)