1 /* Copyright (C
) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
2 Free Software Foundation
, Inc.
4 This file is part of GCC.
6 GCC is free software
; you can redistribute it and
/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation
; either version
3, or (at your option
) any later
11 GCC is distributed in the hope that it will be useful
, but WITHOUT ANY
12 WARRANTY
; without even the implied warranty of MERCHANTABILITY or
13 FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC
; see the file COPYING3. If not see
18 <http
://www.gnu.org
/licenses
/>.
*/
20 /* This header contains a subset of ..
/builtin
-types.def needed for
21 Fortran frontend builtins.
23 Before including this header
, you must define the following macros
:
25 DEF_PRIMITIVE_TYPE (ENUM
, TYPE)
27 The ENUM is an identifier indicating which type is being defined.
28 TYPE is an expression for a `tree
' that represents the type.
30 DEF_FUNCTION_TYPE_0 (ENUM, RETURN)
31 DEF_FUNCTION_TYPE_1 (ENUM, RETURN, ARG1)
32 DEF_FUNCTION_TYPE_2 (ENUM, RETURN, ARG1, ARG2)
33 DEF_FUNCTION_TYPE_3 (ENUM, RETURN, ARG1, ARG2, ARG3)
34 DEF_FUNCTION_TYPE_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4)
35 DEF_FUNCTION_TYPE_5 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5)
36 DEF_FUNCTION_TYPE_6 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)
37 DEF_FUNCTION_TYPE_7 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)
39 These macros describe function types. ENUM is as above. The
40 RETURN type is one of the enumerals already defined. ARG1, ARG2,
41 and ARG3 give the types of the arguments, similarly.
43 DEF_FUNCTION_TYPE_VAR_0 (ENUM, RETURN)
45 Similar, but for function types that take variable arguments.
47 DEF_POINTER_TYPE (ENUM, TYPE)
49 This macro describes a pointer type. ENUM is as above; TYPE is
50 the type pointed to. */
52 DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node)
53 DEF_PRIMITIVE_TYPE (BT_BOOL,
54 (*lang_hooks.types.type_for_size) (BOOL_TYPE_SIZE, 1))
55 DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node)
56 DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node)
57 DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node)
58 DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node)
59 DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 1))
61 DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1))
62 DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1))
63 DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1))
64 DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1))
65 DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
67 DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
68 DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
69 DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
71 (build_qualified_type (void_type_node,
74 DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
75 DEF_POINTER_TYPE (BT_PTR_ULONGLONG, BT_ULONGLONG)
76 DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR)
77 DEF_FUNCTION_TYPE_0 (BT_FN_BOOL, BT_BOOL)
78 DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
79 DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT)
80 DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT)
81 DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID)
83 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR)
84 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
85 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
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)
89 DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
91 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_LONGPTR_LONGPTR,
92 BT_BOOL, BT_PTR_LONG, BT_PTR_LONG)
93 DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
94 BT_BOOL, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
95 DEF_FUNCTION_TYPE_2 (BT_FN_I1_VPTR_I1, BT_I1, BT_VOLATILE_PTR, BT_I1)
96 DEF_FUNCTION_TYPE_2 (BT_FN_I2_VPTR_I2, BT_I2, BT_VOLATILE_PTR, BT_I2)
97 DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4)
98 DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8)
99 DEF_FUNCTION_TYPE_2 (BT_FN_I16_VPTR_I16, BT_I16, BT_VOLATILE_PTR, BT_I16)
100 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR)
102 DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR_PTR, BT_FN_VOID_PTR_PTR)
104 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I1_I1, BT_BOOL, BT_VOLATILE_PTR,
106 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I2_I2, BT_BOOL, BT_VOLATILE_PTR,
108 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I4_I4, BT_BOOL, BT_VOLATILE_PTR,
110 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I8_I8, BT_BOOL, BT_VOLATILE_PTR,
112 DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I16_I16, BT_BOOL, BT_VOLATILE_PTR,
114 DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_I1, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_I1)
115 DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_I2, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_I2)
116 DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_I4, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_I4)
117 DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_I8, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_I8)
118 DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR,
120 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR,
123 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
124 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
125 DEF_FUNCTION_TYPE_4 (BT_FN_VOID_PTR_WORD_WORD_PTR,
126 BT_VOID, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
128 DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
129 BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
130 BT_PTR_LONG, BT_PTR_LONG)
132 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
133 BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
134 BT_PTR_LONG, BT_PTR_LONG)
135 DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
136 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
137 BT_LONG, BT_LONG, BT_LONG)
138 DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
139 BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
140 BT_ULONGLONG, BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
142 DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
143 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
144 BT_LONG, BT_LONG, BT_LONG, BT_LONG)
145 DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT,
146 BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR,
147 BT_PTR_FN_VOID_PTR_PTR, BT_LONG, BT_LONG,
149 DEF_FUNCTION_TYPE_7 (BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
150 BT_BOOL, BT_BOOL, BT_ULONGLONG, BT_ULONGLONG,
151 BT_ULONGLONG, BT_ULONGLONG,
152 BT_PTR_ULONGLONG, BT_PTR_ULONGLONG)
154 DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)