diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:15 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-22 16:55:15 -0400 |
commit | 1f704f761b34e145f5eabdc222301ce6e9ec9102 (patch) | |
tree | 89c8b6dbf40b606ef045929b718d9271093057a3 /gdb/amd64-tdep.c | |
parent | 5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff) | |
download | fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz fsf-binutils-gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.bz2 |
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
Diffstat (limited to 'gdb/amd64-tdep.c')
-rw-r--r-- | gdb/amd64-tdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |