diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-06-28 11:49:22 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-06-28 11:49:22 -0400 |
commit | b447dd03c16d51c7b41c9af0756fc9db4ad95f0d (patch) | |
tree | 4cff1537b99c800351a42d293650b7c51459e710 /gdb/target-descriptions.c | |
parent | c87c999c511f0484de53fa616b0bf6b00c753434 (diff) | |
download | binutils-b447dd03c16d51c7b41c9af0756fc9db4ad95f0d.zip binutils-b447dd03c16d51c7b41c9af0756fc9db4ad95f0d.tar.gz binutils-b447dd03c16d51c7b41c9af0756fc9db4ad95f0d.tar.bz2 |
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/target-descriptions.c')
-rw-r--r-- | gdb/target-descriptions.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index f7d0a68..f94ace7 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -555,7 +555,6 @@ target_find_description (void) { struct gdbarch_info info; - gdbarch_info_init (&info); info.target_desc = tdesc_info->tdesc; if (!gdbarch_update_p (info)) warning (_("Architecture rejected target-supplied description")); @@ -592,7 +591,6 @@ target_clear_description (void) tdesc_info->tdesc = nullptr; gdbarch_info info; - gdbarch_info_init (&info); if (!gdbarch_update_p (info)) internal_error (__FILE__, __LINE__, _("Could not remove target-supplied description")); |