From: Tom Tromey Date: Thu, 2 May 2019 22:13:50 +0000 (-0600) Subject: Convert gdbtypes.c to type-safe registry API X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a1021395e0ef7a92e1653533b753a2221396015;p=binutils-gdb.git Convert gdbtypes.c to type-safe registry API This changes gdbtypes.c to use the type-safe registry API. gdb/ChangeLog 2019-05-08 Tom Tromey * gdbtypes.c (objfile_type_data): Change type. (objfile_type, _initialize_gdbtypes): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 11a973d7ad0..5b0a9fde61f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-05-08 Tom Tromey + + * gdbtypes.c (objfile_type_data): Change type. + (objfile_type, _initialize_gdbtypes): Update. + 2019-05-08 Tom Tromey * dwarf2-frame.c (dwarf2_frame_objfile_data): Change type. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b3424d81be4..59456f9f3a4 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5458,14 +5458,15 @@ gdbtypes_post_init (struct gdbarch *gdbarch) /* This set of objfile-based types is intended to be used by symbol readers as basic types. */ -static const struct objfile_data *objfile_type_data; +static const struct objfile_key> + objfile_type_data; const struct objfile_type * objfile_type (struct objfile *objfile) { struct gdbarch *gdbarch; - struct objfile_type *objfile_type - = (struct objfile_type *) objfile_data (objfile, objfile_type_data); + struct objfile_type *objfile_type = objfile_type_data.get (objfile); if (objfile_type) return objfile_type; @@ -5570,7 +5571,7 @@ objfile_type (struct objfile *objfile) = init_integer_type (objfile, gdbarch_addr_bit (gdbarch), 1, "__CORE_ADDR"); - set_objfile_data (objfile, objfile_type_data, objfile_type); + objfile_type_data.set (objfile, objfile_type); return objfile_type; } @@ -5578,7 +5579,6 @@ void _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); - objfile_type_data = register_objfile_data (); add_setshow_zuinteger_cmd ("overload", no_class, &overload_debug, _("Set debugging of C++ overloading."),