aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-08-31 11:46:25 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-08-31 13:16:13 -0400
commit886176b86503e0b2f7e569fcb96c901fc0d53d52 (patch)
tree85b6cbc2145a01223897ccea910fd2d29f7aba5a /gdb/gdbtypes.c
parent454977cdc414ebdb45cda0072b26569fd387d659 (diff)
downloadgdb-886176b86503e0b2f7e569fcb96c901fc0d53d52.zip
gdb-886176b86503e0b2f7e569fcb96c901fc0d53d52.tar.gz
gdb-886176b86503e0b2f7e569fcb96c901fc0d53d52.tar.bz2
gdb: introduce field::bitsize / field::set_bitsize
Add these two methods, rename the field to m_bitsize to make it pseudo private. Change-Id: Ief95e5cf106e72f2c22ae47b033d0fa47202b413 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 0f0638e..43c09f8 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1320,9 +1320,9 @@ update_static_array_size (struct type *type)
&& TYPE_FIELD_BITSIZE (element_type, 0) != 0
&& get_array_bounds (element_type, &low_bound, &high_bound)
&& high_bound >= low_bound)
- TYPE_FIELD_BITSIZE (type, 0)
- = ((high_bound - low_bound + 1)
- * TYPE_FIELD_BITSIZE (element_type, 0));
+ type->field (0).set_bitsize
+ ((high_bound - low_bound + 1)
+ * TYPE_FIELD_BITSIZE (element_type, 0));
return true;
}
@@ -1359,7 +1359,7 @@ create_array_type_with_stride (type_allocator &alloc,
if (byte_stride_prop != NULL)
result_type->add_dyn_prop (DYN_PROP_BYTE_STRIDE, *byte_stride_prop);
else if (bit_stride > 0)
- TYPE_FIELD_BITSIZE (result_type, 0) = bit_stride;
+ result_type->field (0).set_bitsize (bit_stride);
if (!update_static_array_size (result_type))
{
@@ -5543,7 +5543,7 @@ copy_type_recursive (struct type *type, htab_t copied_types)
{
new_type->field (i).set_is_artificial
(type->field (i).is_artificial ());
- TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i);
+ new_type->field (i).set_bitsize (TYPE_FIELD_BITSIZE (type, i));
if (type->field (i).type ())
new_type->field (i).set_type
(copy_type_recursive (type->field (i).type (), copied_types));
@@ -5710,7 +5710,7 @@ append_flags_type_field (struct type *type, int start_bitpos, int nr_bits,
type->field (field_nr).set_name (xstrdup (name));
type->field (field_nr).set_type (field_type);
type->field (field_nr).set_loc_bitpos (start_bitpos);
- TYPE_FIELD_BITSIZE (type, field_nr) = nr_bits;
+ type->field (field_nr).set_bitsize (nr_bits);
}
/* Special version of append_flags_type_field to add a flag field.