+2019-05-08 Tom Tromey <tom@tromey.com>
+
+ * gdbtypes.c (objfile_type_data): Change type.
+ (objfile_type, _initialize_gdbtypes): Update.
+
2019-05-08 Tom Tromey <tom@tromey.com>
* dwarf2-frame.c (dwarf2_frame_objfile_data): Change type.
/* 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<struct objfile_type,
+ gdb::noop_deleter<struct objfile_type>>
+ 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;
= 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;
}
_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."),