summaryrefslogtreecommitdiff
path: root/gdb/compile/compile-c-types.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 11:05:21 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 11:05:21 -0400
commitdf86565b31bf12aab6fdceade49169bc6f378b13 (patch)
tree76d5944661919552ce4ea01ac49188e151d72fa7 /gdb/compile/compile-c-types.c
parentb6cdbc9a8173b9e6cc8cfc284caa0efa8129ca02 (diff)
downloadbinutils-gdb-df86565b31bf12aab6fdceade49169bc6f378b13.tar.gz
gdb: remove TYPE_LENGTH
Remove the macro, replace all uses with calls to type::length. Change-Id: Ib9bdc954576860b21190886534c99103d6a47afb
Diffstat (limited to 'gdb/compile/compile-c-types.c')
-rw-r--r--gdb/compile/compile-c-types.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index d92bd204485..5cfbeccfc18 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -110,7 +110,7 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
field_type = context->convert_type (type->field (i).type ());
if (bitsize == 0)
- bitsize = 8 * TYPE_LENGTH (type->field (i).type ());
+ bitsize = 8 * type->field (i).type ()->length ();
context->plugin ().build_add_field (result,
type->field (i).name (),
field_type,
@@ -118,7 +118,7 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
type->field (i).loc_bitpos ());
}
- context->plugin ().finish_record_or_union (result, TYPE_LENGTH (type));
+ context->plugin ().finish_record_or_union (result, type->length ());
return result;
}
@@ -131,7 +131,7 @@ convert_enum (compile_c_instance *context, struct type *type)
int i;
int_type = context->plugin ().int_type_v0 (type->is_unsigned (),
- TYPE_LENGTH (type));
+ type->length ());
result = context->plugin ().build_enum_type (int_type);
for (i = 0; i < type->num_fields (); ++i)
@@ -196,16 +196,16 @@ convert_int (compile_c_instance *context, struct type *type)
{
if (type->has_no_signedness ())
{
- gdb_assert (TYPE_LENGTH (type) == 1);
+ gdb_assert (type->length () == 1);
return context->plugin ().char_type ();
}
return context->plugin ().int_type (type->is_unsigned (),
- TYPE_LENGTH (type),
+ type->length (),
type->name ());
}
else
return context->plugin ().int_type_v0 (type->is_unsigned (),
- TYPE_LENGTH (type));
+ type->length ());
}
/* Convert a floating-point type to its gcc representation. */
@@ -214,10 +214,10 @@ static gcc_type
convert_float (compile_c_instance *context, struct type *type)
{
if (context->plugin ().version () >= GCC_C_FE_VERSION_1)
- return context->plugin ().float_type (TYPE_LENGTH (type),
+ return context->plugin ().float_type (type->length (),
type->name ());
else
- return context->plugin ().float_type_v0 (TYPE_LENGTH (type));
+ return context->plugin ().float_type_v0 (type->length ());
}
/* Convert the 'void' type to its gcc representation. */