+/* Build all D language types for the specified architecture. */
+
+static void *
+build_d_types (struct gdbarch *gdbarch)
+{
+ struct builtin_d_type *builtin_d_type
+ = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_d_type);
+
+ /* Basic types. */
+ builtin_d_type->builtin_void
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
+ builtin_d_type->builtin_bool
+ = arch_boolean_type (gdbarch, 8, 1, "bool");
+ builtin_d_type->builtin_byte
+ = arch_integer_type (gdbarch, 8, 0, "byte");
+ builtin_d_type->builtin_ubyte
+ = arch_integer_type (gdbarch, 8, 1, "ubyte");
+ builtin_d_type->builtin_short
+ = arch_integer_type (gdbarch, 16, 0, "short");
+ builtin_d_type->builtin_ushort
+ = arch_integer_type (gdbarch, 16, 1, "ushort");
+ builtin_d_type->builtin_int
+ = arch_integer_type (gdbarch, 32, 0, "int");
+ builtin_d_type->builtin_uint
+ = arch_integer_type (gdbarch, 32, 1, "uint");
+ builtin_d_type->builtin_long
+ = arch_integer_type (gdbarch, 64, 0, "long");
+ builtin_d_type->builtin_ulong
+ = arch_integer_type (gdbarch, 64, 1, "ulong");
+ builtin_d_type->builtin_cent
+ = arch_integer_type (gdbarch, 128, 0, "cent");
+ builtin_d_type->builtin_ucent
+ = arch_integer_type (gdbarch, 128, 1, "ucent");
+ builtin_d_type->builtin_float
+ = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
+ "float", gdbarch_float_format (gdbarch));
+ builtin_d_type->builtin_double
+ = arch_float_type (gdbarch, gdbarch_double_bit (gdbarch),
+ "double", gdbarch_double_format (gdbarch));
+ builtin_d_type->builtin_real
+ = arch_float_type (gdbarch, gdbarch_long_double_bit (gdbarch),
+ "real", gdbarch_long_double_format (gdbarch));
+
+ TYPE_INSTANCE_FLAGS (builtin_d_type->builtin_byte)
+ |= TYPE_INSTANCE_FLAG_NOTTEXT;
+ TYPE_INSTANCE_FLAGS (builtin_d_type->builtin_ubyte)
+ |= TYPE_INSTANCE_FLAG_NOTTEXT;
+
+ /* Imaginary and complex types. */
+ builtin_d_type->builtin_ifloat
+ = arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
+ "ifloat", gdbarch_float_format (gdbarch));
+ builtin_d_type->builtin_idouble
+ = arch_float_type (gdbarch, gdbarch_double_bit (gdbarch),
+ "idouble", gdbarch_double_format (gdbarch));
+ builtin_d_type->builtin_ireal
+ = 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);
+ builtin_d_type->builtin_cdouble
+ = arch_complex_type (gdbarch, "cdouble",
+ builtin_d_type->builtin_double);
+ builtin_d_type->builtin_creal
+ = arch_complex_type (gdbarch, "creal",
+ builtin_d_type->builtin_real);
+
+ /* Character types. */
+ builtin_d_type->builtin_char
+ = arch_character_type (gdbarch, 8, 1, "char");
+ builtin_d_type->builtin_wchar
+ = arch_character_type (gdbarch, 16, 1, "wchar");
+ builtin_d_type->builtin_dchar
+ = arch_character_type (gdbarch, 32, 1, "dchar");
+
+ return builtin_d_type;
+}
+
+static struct gdbarch_data *d_type_data;
+
+/* Return the D type table for the specified architecture. */
+
+const struct builtin_d_type *
+builtin_d_type (struct gdbarch *gdbarch)
+{
+ return (const struct builtin_d_type *) gdbarch_data (gdbarch, d_type_data);
+}