* gdbtypes.h (builtin_type_f_character, builtin_type_f_logical,

builtin_type_f_logical_s1, builtin_type_f_logical_s2,
	builtin_type_f_integer, builtin_type_f_integer_s2, builtin_type_f_real,
	builtin_type_f_real_s8, builtin_type_f_real_s16,
	builtin_type_f_complex_s8, builtin_type_f_complex_s16,
	builtin_type_f_complex_s32, builtin_type_f_void): Replace global
	variable declaration with compatibility macro.
	(struct builtin_f_type): New data type.
	(builtin_f_type): Add prototype.
	* f-lang.c (builtin_type_f_character, builtin_type_f_logical,
	builtin_type_f_logical_s1, builtin_type_f_logical_s2,
	builtin_type_f_integer, builtin_type_f_integer_s2, builtin_type_f_real,
	builtin_type_f_real_s8, builtin_type_f_real_s16,
	builtin_type_f_complex_s8, builtin_type_f_complex_s16,
	builtin_type_f_complex_s32, builtin_type_f_void): Remove variables.
	(f_language_arch_info): Use builtin_f_type instead of variables.
	(build_fortran_types): Build builtin_f_type structure instead of
	setting global type variables.
	(f_type_data): New variable.
	(builtin_f_type): New function.
	(_initialize_f_language): Do not call build_fortran_types.  Do not
	swap global type variables.  Register f_type_data per-gdbarch data.
This commit is contained in:
Ulrich Weigand
2007-06-16 20:09:07 +00:00
parent 92e0cef42c
commit 54ef06c726
3 changed files with 121 additions and 74 deletions

View File

@ -1128,19 +1128,54 @@ extern struct type *builtin_type_m2_bool;
/* Fortran (F77) types */
extern struct type *builtin_type_f_character;
extern struct type *builtin_type_f_integer;
extern struct type *builtin_type_f_integer_s2;
extern struct type *builtin_type_f_logical;
extern struct type *builtin_type_f_logical_s1;
extern struct type *builtin_type_f_logical_s2;
extern struct type *builtin_type_f_real;
extern struct type *builtin_type_f_real_s8;
extern struct type *builtin_type_f_real_s16;
extern struct type *builtin_type_f_complex_s8;
extern struct type *builtin_type_f_complex_s16;
extern struct type *builtin_type_f_complex_s32;
extern struct type *builtin_type_f_void;
struct builtin_f_type
{
struct type *builtin_character;
struct type *builtin_integer;
struct type *builtin_integer_s2;
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
struct type *builtin_complex_s8;
struct type *builtin_complex_s16;
struct type *builtin_complex_s32;
struct type *builtin_void;
};
/* Return the Fortran type table for the specified architecture. */
extern const struct builtin_f_type *builtin_f_type (struct gdbarch *gdbarch);
/* Compatibility macros to access types for the current architecture. */
#define builtin_type_f_character \
(builtin_f_type (current_gdbarch)->builtin_character)
#define builtin_type_f_integer \
(builtin_f_type (current_gdbarch)->builtin_integer)
#define builtin_type_f_integer_s2 \
(builtin_f_type (current_gdbarch)->builtin_integer_s2)
#define builtin_type_f_logical \
(builtin_f_type (current_gdbarch)->builtin_logical)
#define builtin_type_f_logical_s1 \
(builtin_f_type (current_gdbarch)->builtin_logical_s1)
#define builtin_type_f_logical_s2 \
(builtin_f_type (current_gdbarch)->builtin_logical_s2)
#define builtin_type_f_real \
(builtin_f_type (current_gdbarch)->builtin_real)
#define builtin_type_f_real_s8 \
(builtin_f_type (current_gdbarch)->builtin_real_s8)
#define builtin_type_f_real_s16 \
(builtin_f_type (current_gdbarch)->builtin_real_s16)
#define builtin_type_f_complex_s8 \
(builtin_f_type (current_gdbarch)->builtin_complex_s8)
#define builtin_type_f_complex_s16 \
(builtin_f_type (current_gdbarch)->builtin_complex_s16)
#define builtin_type_f_complex_s32 \
(builtin_f_type (current_gdbarch)->builtin_complex_s32)
#define builtin_type_f_void \
(builtin_f_type (current_gdbarch)->builtin_void)
/* RTTI for C++ */
/* extern struct type *builtin_type_cxx_typeinfo; */