Use registry in gdbarch

gdbarch implements its own registry-like approach.  This patch changes
it to instead use registry.h.  It's a rather large patch but largely
uninteresting -- it's mostly a straightforward conversion from the old
approach to the new one.

The main benefit of this change is that it introduces type safety to
the gdbarch registry.  It also removes a bunch of code.

One possible drawback is that, previously, the gdbarch registry
differentiated between pre- and post-initialization setup.  This
doesn't seem very important to me, though.
This commit is contained in:
Tom Tromey
2022-06-01 15:31:15 -06:00
parent 8b15404301
commit cb275538db
41 changed files with 533 additions and 837 deletions

View File

@@ -317,22 +317,22 @@ extern int calc_f77_array_dims (struct type *);
struct builtin_f_type
{
struct type *builtin_character;
struct type *builtin_integer_s1;
struct type *builtin_integer_s2;
struct type *builtin_integer;
struct type *builtin_integer_s8;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
struct type *builtin_logical;
struct type *builtin_logical_s8;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
struct type *builtin_complex;
struct type *builtin_complex_s8;
struct type *builtin_complex_s16;
struct type *builtin_void;
struct type *builtin_character = nullptr;
struct type *builtin_integer_s1 = nullptr;
struct type *builtin_integer_s2 = nullptr;
struct type *builtin_integer = nullptr;
struct type *builtin_integer_s8 = nullptr;
struct type *builtin_logical_s1 = nullptr;
struct type *builtin_logical_s2 = nullptr;
struct type *builtin_logical = nullptr;
struct type *builtin_logical_s8 = nullptr;
struct type *builtin_real = nullptr;
struct type *builtin_real_s8 = nullptr;
struct type *builtin_real_s16 = nullptr;
struct type *builtin_complex = nullptr;
struct type *builtin_complex_s8 = nullptr;
struct type *builtin_complex_s16 = nullptr;
struct type *builtin_void = nullptr;
};
/* Return the Fortran type table for the specified architecture. */