aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-v3-abi.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/gnu-v3-abi.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/gnu-v3-abi.c')
-rw-r--r--gdb/gnu-v3-abi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index b054431..c1967e6 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -1326,7 +1326,7 @@ is_copy_or_move_constructor_type (struct type *class_type,
type_code expected)
{
/* The method should take at least two arguments... */
- if (TYPE_NFIELDS (method_type) < 2)
+ if (method_type->num_fields () < 2)
return false;
/* ...and the second argument should be the same as the class
@@ -1343,7 +1343,7 @@ is_copy_or_move_constructor_type (struct type *class_type,
/* ...and if any of the remaining arguments don't have a default value
then this is not a copy or move constructor, but just a
constructor. */
- for (int i = 2; i < TYPE_NFIELDS (method_type); i++)
+ for (int i = 2; i < method_type->num_fields (); i++)
{
arg_type = TYPE_FIELD_TYPE (method_type, i);
/* FIXME aktemur/2019-10-31: As of this date, neither
@@ -1527,7 +1527,7 @@ gnuv3_pass_by_reference (struct type *type)
are constructed whenever this class is. We do not need to worry
about recursive loops here, since we are only looking at members
of complete class type. Also ignore any static members. */
- for (fieldnum = 0; fieldnum < TYPE_NFIELDS (type); fieldnum++)
+ for (fieldnum = 0; fieldnum < type->num_fields (); fieldnum++)
if (!field_is_static (&TYPE_FIELD (type, fieldnum)))
{
struct type *field_type = TYPE_FIELD_TYPE (type, fieldnum);