gdb: remove gdbarch_info_init
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 28 Jun 2021 15:49:22 +0000 (11:49 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 28 Jun 2021 15:49:22 +0000 (11:49 -0400)
commitb447dd03c16d51c7b41c9af0756fc9db4ad95f0d
tree4cff1537b99c800351a42d293650b7c51459e710
parentc87c999c511f0484de53fa616b0bf6b00c753434
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
18 files changed:
gdb/ChangeLog
gdb/aarch64-linux-nat.c
gdb/aarch64-tdep.c
gdb/arch-utils.c
gdb/arch-utils.h
gdb/arm-tdep.c
gdb/corelow.c
gdb/cris-tdep.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/i386-darwin-nat.c
gdb/inferior.c
gdb/mips-tdep.c
gdb/osabi.c
gdb/rs6000-nat.c
gdb/rs6000-tdep.c
gdb/selftest-arch.c
gdb/target-descriptions.c