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/amd64-tdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/amd64-tdep.c') diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 9fa5d2b..24f0614 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -549,7 +549,7 @@ amd64_has_unaligned_fields (struct type *type) if (type->code () == TYPE_CODE_STRUCT || type->code () == TYPE_CODE_UNION) { - for (int i = 0; i < TYPE_NFIELDS (type); i++) + for (int i = 0; i < type->num_fields (); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); int bitpos = TYPE_FIELD_BITPOS (type, i); @@ -608,7 +608,7 @@ amd64_classify_aggregate_field (struct type *type, int i, { /* Each field of an object is classified recursively. */ int j; - for (j = 0; j < TYPE_NFIELDS (subtype); j++) + for (j = 0; j < subtype->num_fields (); j++) amd64_classify_aggregate_field (subtype, j, theclass, bitpos); return; } @@ -684,7 +684,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2]) gdb_assert (type->code () == TYPE_CODE_STRUCT || type->code () == TYPE_CODE_UNION); - for (i = 0; i < TYPE_NFIELDS (type); i++) + for (i = 0; i < type->num_fields (); i++) amd64_classify_aggregate_field (type, i, theclass, 0); } -- cgit v1.1