if (noside == EVAL_SKIP)
return eval_skip_value (exp);
type = value_type (arg1);
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_FLT:
{
if (noside == EVAL_SKIP)
return eval_skip_value (exp);
type = value_type (arg1);
- if (TYPE_CODE (type) != TYPE_CODE (value_type (arg2)))
+ if (type->code () != value_type (arg2)->code ())
error (_("non-matching types for parameters to MOD ()"));
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_FLT:
{
if (noside == EVAL_SKIP)
return eval_skip_value (exp);
type = value_type (arg1);
- if (TYPE_CODE (type) != TYPE_CODE_FLT)
+ if (type->code () != TYPE_CODE_FLT)
error (_("argument to CEILING must be of type float"));
double val
= target_float_to_host_double (value_contents (arg1),
if (noside == EVAL_SKIP)
return eval_skip_value (exp);
type = value_type (arg1);
- if (TYPE_CODE (type) != TYPE_CODE_FLT)
+ if (type->code () != TYPE_CODE_FLT)
error (_("argument to FLOOR must be of type float"));
double val
= target_float_to_host_double (value_contents (arg1),
if (noside == EVAL_SKIP)
return eval_skip_value (exp);
type = value_type (arg1);
- if (TYPE_CODE (type) != TYPE_CODE (value_type (arg2)))
+ if (type->code () != value_type (arg2)->code ())
error (_("non-matching types for parameters to MODULO ()"));
/* MODULO(A, P) = A - FLOOR (A / P) * P */
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_INT:
{
arg1 = evaluate_subexp (NULL, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
type = value_type (arg1);
- switch (TYPE_CODE (type))
+ switch (type->code ())
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int,
TYPE_LENGTH (type));
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int,
- TYPE_LENGTH (TYPE_TARGET_TYPE(type)));
+ TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
}
/* Should be unreachable. */
f_is_string_type_p (struct type *type)
{
type = check_typedef (type);
- return (TYPE_CODE (type) == TYPE_CODE_STRING
- || (TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CHAR));
+ return (type->code () == TYPE_CODE_STRING
+ || (type->code () == TYPE_CODE_ARRAY
+ && TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_CHAR));
}
/* Special expression lengths for Fortran. */
evaluate_subexp_f
};
-extern const struct language_defn f_language_defn =
+/* Constant data that describes the Fortran language. */
+
+extern const struct language_data f_language_data =
{
"fortran",
"Fortran",
f_emit_char, /* Function to print a single character */
f_print_type, /* Print a type using appropriate syntax */
f_print_typedef, /* Print a typedef using appropriate syntax */
- f_val_print, /* Print a value using appropriate syntax */
f_value_print_innner, /* la_value_print_inner */
c_value_print, /* FIXME */
- default_read_var_value, /* la_read_var_value */
NULL, /* Language specific skip_trampoline */
NULL, /* name_of_this */
false, /* la_store_sym_names_in_linkage_form_p */
f_word_break_characters,
f_collect_symbol_completion_matches,
f_language_arch_info,
- default_print_array_index,
default_pass_by_reference,
c_watch_location_expression,
cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
"(...)" /* la_struct_too_deep_ellipsis */
};
+/* Class representing the Fortran language. */
+
+class f_language : public language_defn
+{
+public:
+ f_language ()
+ : language_defn (language_fortran, f_language_data)
+ { /* Nothing. */ }
+};
+
+/* Single instance of the Fortran language class. */
+
+static f_language f_language_defn;
+
static void *
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);
- builtin_f_type->builtin_complex_s32
- = arch_complex_type (gdbarch, "complex*32",
- builtin_f_type->builtin_real_s16);
+ = init_complex_type ("complex*16", builtin_f_type->builtin_real_s8);
+
+ if (builtin_f_type->builtin_real_s16->code () == TYPE_CODE_ERROR)
+ builtin_f_type->builtin_complex_s32
+ = arch_type (gdbarch, TYPE_CODE_ERROR, 256, "complex*32");
+ else
+ builtin_f_type->builtin_complex_s32
+ = init_complex_type ("complex*32", builtin_f_type->builtin_real_s16);
return builtin_f_type;
}
struct type *
fortran_preserve_arg_pointer (struct value *arg, struct type *type)
{
- if (TYPE_CODE (value_type (arg)) == TYPE_CODE_PTR)
+ if (value_type (arg)->code () == TYPE_CODE_PTR)
return value_type (arg);
return type;
}