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

@@ -210,7 +210,7 @@ gen_trace_static_fields (struct agent_expr *ax,
for (i = type->num_fields () - 1; i >= nbases; i--)
{
if (field_is_static (&type->field (i)))
if (type->field (i).is_static ())
{
gen_static_field (ax, &value, type, i);
if (value.optimized_out)
@@ -1359,7 +1359,7 @@ gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
"this") will have been generated already, which will
be unnecessary but not harmful if the static field is
being handled as a global. */
if (field_is_static (&type->field (i)))
if (type->field (i).is_static ())
{
gen_static_field (ax, value, type, i);
if (value->optimized_out)
@@ -1495,7 +1495,7 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
if (t_field_name && strcmp (t_field_name, fieldname) == 0)
{
if (field_is_static (&t->field (i)))
if (t->field (i).is_static ())
{
gen_static_field (ax, value, t, i);
if (value->optimized_out)