aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-22 16:55:15 -0400
commit1f704f761b34e145f5eabdc222301ce6e9ec9102 (patch)
tree89c8b6dbf40b606ef045929b718d9271093057a3 /gdb/sh-tdep.c
parent5e33d5f4e1a5f2c3556ee31715ddc030d039b597 (diff)
downloadgdb-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/sh-tdep.c')
-rw-r--r--gdb/sh-tdep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index c6bef85..f134cf1 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -813,7 +813,7 @@ static int
sh_use_struct_convention (int renesas_abi, struct type *type)
{
int len = TYPE_LENGTH (type);
- int nelem = TYPE_NFIELDS (type);
+ int nelem = type->num_fields ();
/* The Renesas ABI returns aggregate types always on stack. */
if (renesas_abi && (type->code () == TYPE_CODE_STRUCT
@@ -849,7 +849,7 @@ static int
sh_use_struct_convention_nofpu (int renesas_abi, struct type *type)
{
/* The Renesas ABI returns long longs/doubles etc. always on stack. */
- if (renesas_abi && TYPE_NFIELDS (type) == 0 && TYPE_LENGTH (type) >= 8)
+ if (renesas_abi && type->num_fields () == 0 && TYPE_LENGTH (type) >= 8)
return 1;
return sh_use_struct_convention (renesas_abi, type);
}
@@ -1046,7 +1046,7 @@ sh_treat_as_flt_p (struct type *type)
if (type->code () != TYPE_CODE_STRUCT)
return 0;
/* Otherwise structs with more than one member are not treated as float. */
- if (TYPE_NFIELDS (type) != 1)
+ if (type->num_fields () != 1)
return 0;
/* Otherwise if the type of that member is float, the whole type is
treated as float. */
@@ -1084,7 +1084,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
registers have been used so far. */
if (sh_is_renesas_calling_convention (func_type)
&& TYPE_VARARGS (func_type))
- last_reg_arg = TYPE_NFIELDS (func_type) - 2;
+ last_reg_arg = func_type->num_fields () - 2;
/* First force sp to a 4-byte alignment. */
sp = sh_frame_align (gdbarch, sp);
@@ -1225,7 +1225,7 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
registers have been used so far. */
if (sh_is_renesas_calling_convention (func_type)
&& TYPE_VARARGS (func_type))
- last_reg_arg = TYPE_NFIELDS (func_type) - 2;
+ last_reg_arg = func_type->num_fields () - 2;
/* First force sp to a 4-byte alignment. */
sp = sh_frame_align (gdbarch, sp);