diff options
author | Tom Tromey <tom@tromey.com> | 2020-04-01 14:09:52 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-01 14:09:52 -0600 |
commit | 5b930b4538f70a9f09280e36164840e48fb1c042 (patch) | |
tree | d120a1d21ae82f101767de5a68445d265ca22761 /gdb/d-lang.c | |
parent | 3d1cfd43bec7c22928d12ab235151b8eeeaf4e96 (diff) | |
download | binutils-5b930b4538f70a9f09280e36164840e48fb1c042.zip binutils-5b930b4538f70a9f09280e36164840e48fb1c042.tar.gz binutils-5b930b4538f70a9f09280e36164840e48fb1c042.tar.bz2 |
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 <tom@tromey.com>
* 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) <complex_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.
Diffstat (limited to 'gdb/d-lang.c')
-rw-r--r-- | gdb/d-lang.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/d-lang.c b/gdb/d-lang.c index f50c31a..951e664 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -314,14 +314,11 @@ build_d_types (struct gdbarch *gdbarch) = arch_float_type (gdbarch, gdbarch_long_double_bit (gdbarch), "ireal", gdbarch_long_double_format (gdbarch)); builtin_d_type->builtin_cfloat - = arch_complex_type (gdbarch, "cfloat", - builtin_d_type->builtin_float); + = init_complex_type ("cfloat", builtin_d_type->builtin_float); builtin_d_type->builtin_cdouble - = arch_complex_type (gdbarch, "cdouble", - builtin_d_type->builtin_double); + = init_complex_type ("cdouble", builtin_d_type->builtin_double); builtin_d_type->builtin_creal - = arch_complex_type (gdbarch, "creal", - builtin_d_type->builtin_real); + = init_complex_type ("creal", builtin_d_type->builtin_real); /* Character types. */ builtin_d_type->builtin_char |