1 /* Header for Fortran 95 types backend support.
2 Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
3 Contributed by Paul Brook <paul@nowt.org>
4 and Steven Bosscher <s.bosscher@student.tudelft.nl>
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 #define GFC_DTYPE_RANK_MASK 0x07
28 #define GFC_DTYPE_TYPE_SHIFT 3
29 #define GFC_DTYPE_TYPE_MASK 0x38
30 #define GFC_DTYPE_SIZE_SHIFT 6
34 GFC_DTYPE_UNKNOWN
= 0,
43 extern GTY(()) tree gfc_array_index_type
;
44 extern GTY(()) tree gfc_character1_type_node
;
45 extern GTY(()) tree ppvoid_type_node
;
46 extern GTY(()) tree pvoid_type_node
;
47 extern GTY(()) tree pchar_type_node
;
48 /* This is the type used to hold the lengths of character variables.
49 It must be the same as the corresponding definition in gfortran.h. */
50 /* TODO: This is still hardcoded as kind=4 in some bits of the compiler
51 and runtime library. */
52 extern GTY(()) tree gfc_charlen_type_node
;
55 void gfc_convert_function_code (gfc_namespace
*);
58 void gfc_init_kinds (void);
59 void gfc_init_types (void);
61 tree
gfc_get_int_type (int);
62 tree
gfc_get_real_type (int);
63 tree
gfc_get_complex_type (int);
64 tree
gfc_get_logical_type (int);
65 tree
gfc_get_character_type (int, gfc_charlen
*);
66 tree
gfc_get_character_type_len (int, tree
);
68 tree
gfc_sym_type (gfc_symbol
*);
69 tree
gfc_typenode_for_spec (gfc_typespec
*);
71 tree
gfc_get_function_type (gfc_symbol
*);
73 tree
gfc_type_for_size (unsigned, int);
74 tree
gfc_type_for_mode (enum machine_mode
, int);
75 tree
gfc_unsigned_type (tree
);
76 tree
gfc_signed_type (tree
);
77 tree
gfc_signed_or_unsigned_type (int, tree
);
79 tree
gfc_get_element_type (tree
);
80 tree
gfc_get_array_type_bounds (tree
, int, tree
*, tree
*, int);
81 tree
gfc_get_nodesc_array_type (tree
, gfc_array_spec
*, int);
83 /* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE. */
84 tree
gfc_add_field_to_struct (tree
*, tree
, tree
, tree
);
86 /* Layout and output debugging info for a type. */
87 void gfc_finish_type (tree
);
89 /* Some functions have an extra parameter for the return value. */
90 int gfc_return_by_reference (gfc_symbol
*);
92 /* Returns true if the array sym does not require a descriptor. */
93 int gfc_is_nodesc_array (gfc_symbol
*);