From b447dd03c16d51c7b41c9af0756fc9db4ad95f0d Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 28 Jun 2021 11:49:22 -0400 Subject: 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 --- gdb/cris-tdep.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'gdb/cris-tdep.c') diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index e1c1418..01ef160 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -3879,7 +3879,6 @@ set_cris_version (const char *ignore_args, int from_tty, usr_cmd_cris_version_valid = 1; /* Update the current architecture, if needed. */ - gdbarch_info_init (&info); if (!gdbarch_update_p (info)) internal_error (__FILE__, __LINE__, _("cris_gdbarch_update: failed to update architecture.")); @@ -3892,7 +3891,6 @@ set_cris_mode (const char *ignore_args, int from_tty, struct gdbarch_info info; /* Update the current architecture, if needed. */ - gdbarch_info_init (&info); if (!gdbarch_update_p (info)) internal_error (__FILE__, __LINE__, "cris_gdbarch_update: failed to update architecture."); @@ -3905,7 +3903,6 @@ set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, struct gdbarch_info info; /* Update the current architecture, if needed. */ - gdbarch_info_init (&info); if (!gdbarch_update_p (info)) internal_error (__FILE__, __LINE__, _("cris_gdbarch_update: failed to update architecture.")); -- cgit v1.1