aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-04-01 14:09:52 -0600
committerTom Tromey <tromey@adacore.com>2020-04-01 14:09:52 -0600
commit5b930b4538f70a9f09280e36164840e48fb1c042 (patch)
treed120a1d21ae82f101767de5a68445d265ca22761 /gdb/gdbtypes.h
parent3d1cfd43bec7c22928d12ab235151b8eeeaf4e96 (diff)
downloadgdb-5b930b4538f70a9f09280e36164840e48fb1c042.zip
gdb-5b930b4538f70a9f09280e36164840e48fb1c042.tar.gz
gdb-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/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index cb674db..77cc92e 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -803,6 +803,10 @@ struct main_type
struct range_bounds *bounds;
+ /* If this is a scalar type, then this is its corresponding
+ complex type. */
+ struct type *complex_type;
+
} flds_bnds;
/* * Slot to point to additional language-specific fields of this
@@ -1841,8 +1845,7 @@ extern struct type *init_float_type (struct objfile *, int, const char *,
const struct floatformat **,
enum bfd_endian = BFD_ENDIAN_UNKNOWN);
extern struct type *init_decfloat_type (struct objfile *, int, const char *);
-extern struct type *init_complex_type (struct objfile *, const char *,
- struct type *);
+extern struct type *init_complex_type (const char *, struct type *);
extern struct type *init_pointer_type (struct objfile *, int, const char *,
struct type *);
@@ -1858,8 +1861,6 @@ extern struct type *arch_boolean_type (struct gdbarch *, int, int,
extern struct type *arch_float_type (struct gdbarch *, int, const char *,
const struct floatformat **);
extern struct type *arch_decfloat_type (struct gdbarch *, int, const char *);
-extern struct type *arch_complex_type (struct gdbarch *, const char *,
- struct type *);
extern struct type *arch_pointer_type (struct gdbarch *, int, const char *,
struct type *);