2016-08-24 Michael Collison <michael.collison@linaro.org>
[official-gcc.git] / gcc / fortran / types.def
blob8780b761da94cb87a287d330458e87d50b397c0b
1 /* Copyright (C) 2001-2016 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 3, or (at your option) any later
8 version.
10 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 for more details.
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>. */
19 /* This header contains a subset of ../builtin-types.def needed for
20 Fortran frontend builtins.
22 Before including this header, you must define the following macros:
24 DEF_PRIMITIVE_TYPE (ENUM, TYPE)
26 The ENUM is an identifier indicating which type is being defined.
27 TYPE is an expression for a `tree' that represents the type.
29 DEF_FUNCTION_TYPE_0 (ENUM, RETURN)
30 DEF_FUNCTION_TYPE_1 (ENUM, RETURN, ARG1)
31 DEF_FUNCTION_TYPE_2 (ENUM, RETURN, ARG1, ARG2)
32 [...]
34 These macros describe function types. ENUM is as above. The
35 RETURN type is one of the enumerals already defined. ARG1, ARG2,
36 and ARG3 give the types of the arguments, similarly.
38 DEF_FUNCTION_TYPE_VAR_0 (ENUM, RETURN)
40 Similar, but for function types that take variable arguments.
42 DEF_POINTER_TYPE (ENUM, TYPE)
44 This macro describes a pointer type. ENUM is as above; TYPE is
45 the type pointed to. */
47 DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node)
48 DEF_PRIMITIVE_TYPE (BT_BOOL,
49 (*lang_hooks.types.type_for_size) (BOOL_TYPE_SIZE, 1))
50 DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node)
51 DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node)
52 DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node)
53 DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node)
54 DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1))
55 DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
57 DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1))
58 DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1))
59 DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1))
60 DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1))
61 DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
63 DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
64 DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
65 DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
66 build_pointer_type
67 (build_qualified_type (void_type_node,
68 TYPE_QUAL_VOLATILE)))
69 DEF_PRIMITIVE_TYPE (BT_CONST_VOLATILE_PTR,
70 build_pointer_type
71 (build_qualified_type (void_type_node,
72 TYPE_QUAL_VOLATILE|TYPE_QUAL_CONST)))
73 DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
74 DEF_POINTER_TYPE (BT_PTR_ULONGLONG, BT_ULONGLONG)
75 DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR)
76 DEF_FUNCTION_TYPE_0 (BT_FN_BOOL, BT_BOOL)
77 DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
78 DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT)
79 DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT)
80 DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID)
82 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR)
83 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
84 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
85 DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
86 DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
87 DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
88 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
89 DEF_FUNCTION_TYPE_1 (BT_FN_BOOL_INT, BT_BOOL, BT_INT)
91 DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
93 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_LONGPTR_LONGPTR,
94 BT_BOOL, BT_PTR_LONG, BT_PTR_LONG)
95 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
96 BT_BOOL, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
97 DEF_FUNCTION_TYPE_2 (BT_FN_I1_VPTR_I1, BT_I1, BT_VOLATILE_PTR, BT_I1)
98 DEF_FUNCTION_TYPE_2 (BT_FN_I2_VPTR_I2, BT_I2, BT_VOLATILE_PTR, BT_I2)
99 DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4)
100 DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8)
101 DEF_FUNCTION_TYPE_2 (BT_FN_I16_VPTR_I16, BT_I16, BT_VOLATILE_PTR, BT_I16)
102 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR)
103 DEF_FUNCTION_TYPE_2 (BT_FN_I1_CONST_VPTR_INT, BT_I1, BT_CONST_VOLATILE_PTR,
104 BT_INT)
105 DEF_FUNCTION_TYPE_2 (BT_FN_I2_CONST_VPTR_INT, BT_I2, BT_CONST_VOLATILE_PTR,
106 BT_INT)
107 DEF_FUNCTION_TYPE_2 (BT_FN_I4_CONST_VPTR_INT, BT_I4, BT_CONST_VOLATILE_PTR,
108 BT_INT)
109 DEF_FUNCTION_TYPE_2 (BT_FN_I8_CONST_VPTR_INT, BT_I8, BT_CONST_VOLATILE_PTR,
110 BT_INT)
111 DEF_FUNCTION_TYPE_2 (BT_FN_I16_CONST_VPTR_INT, BT_I16, BT_CONST_VOLATILE_PTR,
112 BT_INT)
113 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VPTR_INT, BT_VOID, BT_VOLATILE_PTR, BT_INT)
114 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_VPTR_INT, BT_BOOL, BT_VOLATILE_PTR, BT_INT)
115 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_SIZE_CONST_VPTR, BT_BOOL, BT_SIZE,
116 BT_CONST_VOLATILE_PTR)
117 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_INT_BOOL, BT_BOOL, BT_INT, BT_BOOL)
118 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_UINT_UINT, BT_VOID, BT_UINT, BT_UINT)
120 DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
122 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I1_I1, BT_BOOL, BT_VOLATILE_PTR,
123 BT_I1, BT_I1)
124 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I2_I2, BT_BOOL, BT_VOLATILE_PTR,
125 BT_I2, BT_I2)
126 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I4_I4, BT_BOOL, BT_VOLATILE_PTR,
127 BT_I4, BT_I4)
128 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I8_I8, BT_BOOL, BT_VOLATILE_PTR,
129 BT_I8, BT_I8)
130 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I16_I16, BT_BOOL, BT_VOLATILE_PTR,
131 BT_I16, BT_I16)
132 DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_I1, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_I1)
133 DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_I2, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_I2)
134 DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_I4, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_I4)
135 DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_I8, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_I8)
136 DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR,
137 BT_I16, BT_I16)
138 DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_INT, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_INT)
139 DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_INT, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_INT)
140 DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_INT, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_INT)
141 DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_INT, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_INT)
142 DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_INT, BT_I16, BT_VOLATILE_PTR, BT_I16, BT_INT)
143 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I1_INT, BT_VOID, BT_VOLATILE_PTR, BT_I1, BT_INT)
144 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I2_INT, BT_VOID, BT_VOLATILE_PTR, BT_I2, BT_INT)
145 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I4_INT, BT_VOID, BT_VOLATILE_PTR, BT_I4, BT_INT)
146 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I8_INT, BT_VOID, BT_VOLATILE_PTR, BT_I8, BT_INT)
147 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_VPTR_I16_INT, BT_VOID, BT_VOLATILE_PTR, BT_I16, BT_INT)
149 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
150 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
151 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
152 BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
153 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_VPTR_PTR_INT, BT_VOID, BT_SIZE,
154 BT_VOLATILE_PTR, BT_PTR, BT_INT)
155 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_VOID, BT_SIZE,
156 BT_CONST_VOLATILE_PTR, BT_PTR, BT_INT)
157 DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_LONGPTR_LONGPTR_LONGPTR,
158 BT_BOOL, BT_UINT, BT_PTR_LONG, BT_PTR_LONG, BT_PTR_LONG)
159 DEF_FUNCTION_TYPE_4 (BT_FN_BOOL_UINT_ULLPTR_ULLPTR_ULLPTR,
160 BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG,
161 BT_PTR_ULONGLONG)
162 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_UINT_PTR_INT_PTR, BT_VOID, BT_INT, BT_PTR,
163 BT_INT, BT_PTR)
165 DEF_FUNCTION_TYPE_5 (BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
166 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT,
167 BT_UINT)
168 DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
169 BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
170 BT_PTR_LONG, BT_PTR_LONG)
171 DEF_FUNCTION_TYPE_5 (BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT, BT_VOID, BT_SIZE,
172 BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT)
173 DEF_FUNCTION_TYPE_5 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR,
174 BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR, BT_PTR)
175 DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_LONGPTR_LONG_LONGPTR_LONGPTR,
176 BT_BOOL, BT_UINT, BT_PTR_LONG, BT_LONG, BT_PTR_LONG,
177 BT_PTR_LONG)
178 DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_UINT_ULLPTR_ULL_ULLPTR_ULLPTR,
179 BT_BOOL, BT_UINT, BT_PTR_ULONGLONG, BT_ULONGLONG,
180 BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
182 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
183 BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
184 BT_PTR_LONG, BT_PTR_LONG)
185 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
186 BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
187 BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
188 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT,
189 BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I1, BT_BOOL, BT_INT,
190 BT_INT)
191 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT,
192 BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I2, BT_BOOL, BT_INT,
193 BT_INT)
194 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT,
195 BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I4, BT_BOOL, BT_INT,
196 BT_INT)
197 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT,
198 BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I8, BT_BOOL, BT_INT,
199 BT_INT)
200 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT,
201 BT_BOOL, BT_VOLATILE_PTR, BT_PTR, BT_I16, BT_BOOL, BT_INT,
202 BT_INT)
203 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT, BT_BOOL, BT_SIZE,
204 BT_VOLATILE_PTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
206 DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
207 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
208 BT_LONG, BT_LONG, BT_LONG, BT_UINT)
209 DEF_FUNCTION_TYPE_7 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
210 BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
211 BT_ULONGLONG, BT_ULONGLONG,
212 BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
213 DEF_FUNCTION_TYPE_7 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_UINT_PTR,
214 BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR, BT_PTR, BT_UINT,
215 BT_PTR)
217 DEF_FUNCTION_TYPE_8 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
218 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
219 BT_LONG, BT_LONG, BT_LONG, BT_LONG, BT_UINT)
221 DEF_FUNCTION_TYPE_9 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT,
222 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
223 BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
224 BT_BOOL, BT_UINT, BT_PTR, BT_INT)
225 DEF_FUNCTION_TYPE_9 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR,
226 BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_SIZE, BT_PTR,
227 BT_PTR, BT_PTR, BT_UINT, BT_PTR, BT_PTR)
229 DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_LONG_LONG_LONG,
230 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
231 BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
232 BT_UINT, BT_LONG, BT_INT, BT_LONG, BT_LONG, BT_LONG)
233 DEF_FUNCTION_TYPE_11 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_UINT_LONG_INT_ULL_ULL_ULL,
234 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
235 BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
236 BT_UINT, BT_LONG, BT_INT,
237 BT_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG)
239 DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
241 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_LONG_VAR,
242 BT_VOID, BT_LONG)
243 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_ULL_VAR,
244 BT_VOID, BT_ULONGLONG)
246 DEF_FUNCTION_TYPE_VAR_2 (BT_FN_VOID_INT_INT_VAR, BT_VOID, BT_INT, BT_INT)
248 DEF_FUNCTION_TYPE_VAR_7 (BT_FN_VOID_INT_SIZE_PTR_PTR_PTR_INT_INT_VAR,
249 BT_VOID, BT_INT, BT_SIZE, BT_PTR, BT_PTR,
250 BT_PTR, BT_INT, BT_INT)
252 DEF_FUNCTION_TYPE_VAR_6 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_VAR,
253 BT_VOID, BT_INT, BT_PTR_FN_VOID_PTR, BT_SIZE,
254 BT_PTR, BT_PTR, BT_PTR)