aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile/compile-object-load.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/compile/compile-object-load.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/compile/compile-object-load.c')
-rw-r--r--gdb/compile/compile-object-load.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 76a9418..7f5f593 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -505,7 +505,7 @@ get_regs_type (struct symbol *func_sym, struct objfile *objfile)
struct type *regsp_type, *regs_type;
/* No register parameter present. */
- if (TYPE_NFIELDS (func_type) == 0)
+ if (func_type->num_fields () == 0)
return NULL;
regsp_type = check_typedef (TYPE_FIELD_TYPE (func_type, 0));
@@ -534,7 +534,7 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
struct gdbarch *gdbarch = target_gdbarch ();
int fieldno;
- for (fieldno = 0; fieldno < TYPE_NFIELDS (regs_type); fieldno++)
+ for (fieldno = 0; fieldno < regs_type->num_fields (); fieldno++)
{
const char *reg_name = TYPE_FIELD_NAME (regs_type, fieldno);
ULONGEST reg_bitpos = TYPE_FIELD_BITPOS (regs_type, fieldno);
@@ -670,10 +670,10 @@ compile_object_load (const compile_file_names &file_names,
default:
internal_error (__FILE__, __LINE__, _("invalid scope %d"), scope);
}
- if (TYPE_NFIELDS (func_type) != expect_parameters)
+ if (func_type->num_fields () != expect_parameters)
error (_("Invalid %d parameters of function \"%s\" in compiled "
"module \"%s\"."),
- TYPE_NFIELDS (func_type), GCC_FE_WRAPPER_FUNCTION,
+ func_type->num_fields (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
if (!types_deeply_equal (expect_return_type, TYPE_TARGET_TYPE (func_type)))
error (_("Invalid return type of function \"%s\" in compiled "