summaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-06-28 11:49:22 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-06-28 11:49:22 -0400
commitb447dd03c16d51c7b41c9af0756fc9db4ad95f0d (patch)
tree4cff1537b99c800351a42d293650b7c51459e710 /gdb/mips-tdep.c
parentc87c999c511f0484de53fa616b0bf6b00c753434 (diff)
downloadbinutils-gdb-b447dd03c16d51c7b41c9af0756fc9db4ad95f0d.tar.gz
gdb: remove gdbarch_info_init
While reviewing another patch, I realized that gdbarch_info_init could easily be removed in favor of initializing gdbarch_info fields directly in the struct declaration. The only odd part is the union. I don't know if it's actually important for it to be zero-initialized, but I presume it is. I added a constructor to gdbarch_info to take care of that. A proper solution would be to use std::variant. Or, these could also be separate fields, the little extra space required wouldn't matter. gdb/ChangeLog: * gdbarch.sh (struct gdbarch_info): Initialize fields, add constructor. * gdbarch.h: Re-generate. * arch-utils.h (gdbarch_info_init): Remove, delete all usages. * arch-utils.c (gdbarch_info_init): Remove. Change-Id: I7502e08fe0f278d84eef1667a072e8a97bda5ab5
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index dbace121250..2aee4f10b31 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -865,7 +865,6 @@ set_mips64_transfers_32bit_regs (const char *args, int from_tty,
struct cmd_list_element *c)
{
struct gdbarch_info info;
- gdbarch_info_init (&info);
/* FIXME: cagney/2003-11-15: Should be setting a field in "info"
instead of relying on globals. Doing that would let generic code
handle the search for this specific architecture. */
@@ -6918,7 +6917,6 @@ static void
set_mipsfpu_single_command (const char *args, int from_tty)
{
struct gdbarch_info info;
- gdbarch_info_init (&info);
mips_fpu_type = MIPS_FPU_SINGLE;
mips_fpu_type_auto = 0;
/* FIXME: cagney/2003-11-15: Should be setting a field in "info"
@@ -6932,7 +6930,6 @@ static void
set_mipsfpu_double_command (const char *args, int from_tty)
{
struct gdbarch_info info;
- gdbarch_info_init (&info);
mips_fpu_type = MIPS_FPU_DOUBLE;
mips_fpu_type_auto = 0;
/* FIXME: cagney/2003-11-15: Should be setting a field in "info"
@@ -6946,7 +6943,6 @@ static void
set_mipsfpu_none_command (const char *args, int from_tty)
{
struct gdbarch_info info;
- gdbarch_info_init (&info);
mips_fpu_type = MIPS_FPU_NONE;
mips_fpu_type_auto = 0;
/* FIXME: cagney/2003-11-15: Should be setting a field in "info"
@@ -8790,7 +8786,6 @@ mips_abi_update (const char *ignore_args,
/* Force the architecture to update, and (if it's a MIPS architecture)
mips_gdbarch_init will take care of the rest. */
- gdbarch_info_init (&info);
gdbarch_update_p (info);
}