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/f-lang.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gdb/f-lang.c') diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 75a131d..2ce4ad4 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -741,14 +741,11 @@ build_fortran_types (struct gdbarch *gdbarch) = arch_type (gdbarch, TYPE_CODE_ERROR, 128, "real*16"); builtin_f_type->builtin_complex_s8 - = arch_complex_type (gdbarch, "complex*8", - builtin_f_type->builtin_real); + = init_complex_type ("complex*8", builtin_f_type->builtin_real); builtin_f_type->builtin_complex_s16 - = arch_complex_type (gdbarch, "complex*16", - builtin_f_type->builtin_real_s8); + = init_complex_type ("complex*16", builtin_f_type->builtin_real_s8); builtin_f_type->builtin_complex_s32 - = arch_complex_type (gdbarch, "complex*32", - builtin_f_type->builtin_real_s16); + = init_complex_type ("complex*32", builtin_f_type->builtin_real_s16); return builtin_f_type; } -- cgit v1.1