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/riscv-tdep.c | |
parent | 5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff) | |
download | gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.zip gdb-1f704f761b34e145f5eabdc222301ce6e9ec9102.tar.gz 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/riscv-tdep.c')
-rw-r--r-- | gdb/riscv-tdep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 4b0dd02..0842dcb 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -642,11 +642,11 @@ riscv_print_one_register_info (struct gdbarch *gdbarch, if (regtype->code () == TYPE_CODE_FLT || (regtype->code () == TYPE_CODE_UNION - && TYPE_NFIELDS (regtype) == 2 + && regtype->num_fields () == 2 && TYPE_FIELD_TYPE (regtype, 0)->code () == TYPE_CODE_FLT && TYPE_FIELD_TYPE (regtype, 1)->code () == TYPE_CODE_FLT) || (regtype->code () == TYPE_CODE_UNION - && TYPE_NFIELDS (regtype) == 3 + && regtype->num_fields () == 3 && TYPE_FIELD_TYPE (regtype, 0)->code () == TYPE_CODE_FLT && TYPE_FIELD_TYPE (regtype, 1)->code () == TYPE_CODE_FLT && TYPE_FIELD_TYPE (regtype, 2)->code () == TYPE_CODE_FLT)) @@ -2044,7 +2044,7 @@ private: void riscv_struct_info::analyse_inner (struct type *type, int offset) { - unsigned int count = TYPE_NFIELDS (type); + unsigned int count = type->num_fields (); unsigned int i; for (i = 0; i < count; ++i) @@ -2445,7 +2445,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch, arg_type = check_typedef (value_type (arg_value)); riscv_arg_location (gdbarch, info, &call_info, arg_type, - TYPE_VARARGS (ftype) && i >= TYPE_NFIELDS (ftype)); + TYPE_VARARGS (ftype) && i >= ftype->num_fields ()); if (info->type != arg_type) arg_value = value_cast (info->type, arg_value); |