gdb: remove FIELD_BITSIZE

Replace with field::bitsize.

Change-Id: I400be235d6a1f446d0a4aafac01df5e850185d3a
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Simon Marchi 2023-08-31 11:46:26 -04:00 committed by Simon Marchi
parent 886176b865
commit 3be8c91910
4 changed files with 8 additions and 10 deletions

View File

@ -11722,7 +11722,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
fp->set_loc_bitpos (fp->loc_bitpos ()
+ anonymous_size * bits_per_byte
- bit_offset - FIELD_BITSIZE (*fp));
- bit_offset - fp->bitsize ());
}
}

View File

@ -4244,7 +4244,7 @@ check_types_equal (struct type *type1, struct type *type2,
const struct field *field2 = &type2->field (i);
if (field1->is_artificial () != field2->is_artificial ()
|| FIELD_BITSIZE (*field1) != FIELD_BITSIZE (*field2)
|| field1->bitsize () != field2->bitsize ()
|| field1->loc_kind () != field2->loc_kind ())
return false;
if (!compare_maybe_null_strings (field1->name (), field2->name ()))

View File

@ -1933,10 +1933,8 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize ())
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE((thistype)->field (n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE((thistype)->field (n))!=0)
#define TYPE_FIELD_BITSIZE(thistype, n) ((thistype)->field (n).bitsize ())
#define TYPE_FIELD_PACKED(thistype, n) (((thistype)->field (n).bitsize ())!=0)
#define TYPE_FIELD_PRIVATE_BITS(thistype) \
TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits

View File

@ -2873,7 +2873,7 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp,
}
if (fip->list->field.loc_bitpos () == 0
&& FIELD_BITSIZE (fip->list->field) == 0)
&& fip->list->field.bitsize () == 0)
{
/* This can happen in two cases: (1) at least for gcc 2.4.5 or so,
it is a field which has been optimized out. The correct stab for
@ -2908,11 +2908,11 @@ read_one_struct_field (struct stab_field_info *fip, const char **pp,
{
fip->list->field.set_bitsize (0);
}
if ((FIELD_BITSIZE (fip->list->field)
if ((fip->list->field.bitsize ()
== TARGET_CHAR_BIT * field_type->length ()
|| (field_type->code () == TYPE_CODE_ENUM
&& FIELD_BITSIZE (fip->list->field)
== gdbarch_int_bit (gdbarch))
&& (fip->list->field.bitsize ()
== gdbarch_int_bit (gdbarch)))
)
&&
fip->list->field.loc_bitpos () % 8 == 0)