From 1f704f761b34e145f5eabdc222301ce6e9ec9102 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 22 May 2020 16:55:15 -0400 Subject: gdb: remove TYPE_NFIELDS macro Remove `TYPE_NFIELDS`, changing all the call sites to use `type::num_fields` directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_NFIELDS): Remove. Change all cal sites to use type::num_fields instead. Change-Id: Ib73be4c36f9e770e0f729bac3b5257d7cb2f9591 --- gdb/v850-tdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/v850-tdep.c') diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 1e0fd41a532..298613e42c3 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -532,7 +532,7 @@ v850_use_struct_convention (struct gdbarch *gdbarch, struct type *type) type whose size is greater than or equal to 4 -> returned in register. */ if ((type->code () == TYPE_CODE_STRUCT || type->code () == TYPE_CODE_UNION) - && TYPE_NFIELDS (type) == 1) + && type->num_fields () == 1) { fld_type = TYPE_FIELD_TYPE (type, 0); if (v850_type_is_scalar (fld_type) && TYPE_LENGTH (fld_type) >= 4) @@ -553,7 +553,7 @@ v850_use_struct_convention (struct gdbarch *gdbarch, struct type *type) && v850_type_is_scalar (TYPE_FIELD_TYPE (type, 0)) && TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)) == 4) { - for (i = 1; i < TYPE_NFIELDS (type); ++i) + for (i = 1; i < type->num_fields (); ++i) { fld_type = TYPE_FIELD_TYPE (type, 0); if (fld_type->code () == TYPE_CODE_ARRAY) @@ -572,7 +572,7 @@ v850_use_struct_convention (struct gdbarch *gdbarch, struct type *type) returned in register. */ if (type->code () == TYPE_CODE_UNION) { - for (i = 0; i < TYPE_NFIELDS (type); ++i) + for (i = 0; i < type->num_fields (); ++i) { fld_type = TYPE_FIELD_TYPE (type, 0); if (!v850_use_struct_convention (gdbarch, fld_type)) @@ -981,7 +981,7 @@ v850_eight_byte_align_p (struct type *type) { int i; - for (i = 0; i < TYPE_NFIELDS (type); i++) + for (i = 0; i < type->num_fields (); i++) { if (v850_eight_byte_align_p (TYPE_FIELD_TYPE (type, i))) return 1; -- cgit v1.2.1