From 5b930b4538f70a9f09280e36164840e48fb1c042 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 1 Apr 2020 14:09:52 -0600 Subject: Change how complex types are created This patch changes how complex types are created. init_complex_type and arch_complex_type are unified, and complex types are reused, by attaching them to the underlying scalar type. gdb/ChangeLog 2020-04-01 Tom Tromey * stabsread.c (rs6000_builtin_type, read_sun_floating_type) (read_range_type): Update. * mdebugread.c (basic_type): Update. * go-lang.c (build_go_types): Use init_complex_type. * gdbtypes.h (struct main_type) : New member. (init_complex_type): Update. (arch_complex_type): Don't declare. * gdbtypes.c (init_complex_type): Remove "objfile" parameter. Make name if none given. Use alloc_type_copy. Look for cached complex type. (arch_complex_type): Remove. (gdbtypes_post_init): Use init_complex_type. * f-lang.c (build_fortran_types): Use init_complex_type. * dwarf2/read.c (read_base_type): Update. * d-lang.c (build_d_types): Use init_complex_type. * ctfread.c (read_base_type): Update. --- gdb/dwarf2/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/dwarf2') diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6ee33fc..2db527e 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -16880,7 +16880,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) case DW_ATE_complex_float: type = dwarf2_init_complex_target_type (cu, objfile, bits / 2, name, byte_order); - type = init_complex_type (objfile, name, type); + type = init_complex_type (name, type); break; case DW_ATE_decimal_float: type = init_decfloat_type (objfile, bits, name); -- cgit v1.1