OSDN Git Service

really remove signed(_or_unsigned)?_type langhooks
[pf3gnuchains/gcc-fork.git] / gcc / fortran / trans-types.h
1 /* Header for Fortran 95 types backend support.
2    Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation,
3    Inc.
4    Contributed by Paul Brook <paul@nowt.org>
5    and Steven Bosscher <s.bosscher@student.tudelft.nl>
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING.  If not, write to the Free
21 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 02110-1301, USA.  */
23
24
25 #ifndef GFC_BACKEND_H
26 #define GFC_BACKEND_H
27
28 #define GFC_DTYPE_RANK_MASK 0x07
29 #define GFC_DTYPE_TYPE_SHIFT 3
30 #define GFC_DTYPE_TYPE_MASK 0x38
31 #define GFC_DTYPE_SIZE_SHIFT 6
32
33 enum
34 {
35   GFC_DTYPE_UNKNOWN = 0,
36   GFC_DTYPE_INTEGER,
37   GFC_DTYPE_LOGICAL,
38   GFC_DTYPE_REAL,
39   GFC_DTYPE_COMPLEX,
40   GFC_DTYPE_DERIVED,
41   GFC_DTYPE_CHARACTER
42 };
43
44 extern GTY(()) tree gfc_array_index_type;
45 extern GTY(()) tree gfc_array_range_type;
46 extern GTY(()) tree gfc_character1_type_node;
47 extern GTY(()) tree ppvoid_type_node;
48 extern GTY(()) tree pvoid_type_node;
49 extern GTY(()) tree pchar_type_node;
50
51 /* This is the type used to hold the lengths of character variables.
52    It must be the same as the corresponding definition in gfortran.h.  */
53 /* TODO: This is still hardcoded as kind=4 in some bits of the compiler
54    and runtime library.  */
55 extern GTY(()) tree gfc_charlen_type_node;
56
57 typedef enum {
58   PACKED_NO = 0,
59   PACKED_PARTIAL,
60   PACKED_FULL,
61   PACKED_STATIC
62 } gfc_packed;
63
64 /* be-function.c */
65 void gfc_convert_function_code (gfc_namespace *);
66
67 /* trans-types.c */
68 void gfc_init_kinds (void);
69 void gfc_init_types (void);
70
71 tree gfc_get_int_type (int);
72 tree gfc_get_real_type (int);
73 tree gfc_get_complex_type (int);
74 tree gfc_get_logical_type (int);
75 tree gfc_get_character_type (int, gfc_charlen *);
76 tree gfc_get_character_type_len (int, tree);
77
78 tree gfc_sym_type (gfc_symbol *);
79 tree gfc_typenode_for_spec (gfc_typespec *);
80
81 tree gfc_get_function_type (gfc_symbol *);
82
83 tree gfc_type_for_size (unsigned, int);
84 tree gfc_type_for_mode (enum machine_mode, int);
85
86 tree gfc_get_element_type (tree);
87 tree gfc_get_array_type_bounds (tree, int, tree *, tree *, int);
88 tree gfc_get_nodesc_array_type (tree, gfc_array_spec *, gfc_packed);
89
90 /* Add a field of given name and type to a UNION_TYPE or RECORD_TYPE.  */
91 tree gfc_add_field_to_struct (tree *, tree, tree, tree);
92
93 /* Layout and output debugging info for a type.  */
94 void gfc_finish_type (tree);
95
96 /* Some functions have an extra parameter for the return value.  */
97 int gfc_return_by_reference (gfc_symbol *);
98
99 /* Returns true if the array sym does not require a descriptor.  */
100 int gfc_is_nodesc_array (gfc_symbol *);
101
102 /* Return the DTYPE for an array.  */
103 tree gfc_get_dtype (tree);
104
105 #endif