PR opt/3995
[official-gcc.git] / gcc / builtin-types.def
blob7a33ffd78945b1592216a605082313c0efabdcf6
1 /* Copyright (C) 2001 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 2, 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 COPYING. If not, write to the Free
17 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
18 02111-1307, USA. */
20 /* This header provides a declaritive way of describing the types that
21 are used when declaring builtin functions.
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)
36 These macros describe function types. ENUM is as above. The
37 RETURN type is one of the enumerals already defined. ARG1, ARG2,
38 and ARG3 give the types of the arguments, similarly.
40 DEF_FUNCTION_TYPE_VAR_0 (ENUM, RETURN)
41 DEF_FUNCTION_TYPE_VAR_1 (ENUM, RETURN, ARG1)
42 DEF_FUNCTION_TYPE_VAR_2 (ENUM, RETURN, ARG1, ARG2)
44 Similar, but for function types that take variable arguments.
45 For example:
47 DEF_FUNCTION_TYPE_1 (BT_INT_DOUBLE, BT_INT, BT_DOUBLE)
49 describes the type `int ()(double)', using the enumeral
50 BT_INT_DOUBLE, whereas:
52 DEF_FUNCTION_TYPE_VAR_1 (BT_INT_DOUBLE_VAR, BT_INT, BT_DOUBLE)
54 describes the type `int ()(double, ...)'.
56 DEF_POINTER_TYPE (ENUM, TYPE)
58 This macro describes a pointer type. ENUM is as above; TYPE is
59 the type pointed to. */
61 DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node)
62 DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node)
63 DEF_PRIMITIVE_TYPE (BT_UNSIGNED, unsigned_type_node)
64 DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node)
65 DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node)
66 DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
67 DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node)
68 DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node)
69 DEF_PRIMITIVE_TYPE (BT_LONG_DOUBLE, long_double_type_node)
70 DEF_PRIMITIVE_TYPE (BT_COMPLEX_FLOAT, complex_float_type_node)
71 DEF_PRIMITIVE_TYPE (BT_COMPLEX_DOUBLE, complex_double_type_node)
72 DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONG_DOUBLE, complex_long_double_type_node)
74 DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
75 DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
76 DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
77 DEF_PRIMITIVE_TYPE (BT_SIZE, c_size_type_node)
78 DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
79 DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node)
81 DEF_PRIMITIVE_TYPE (BT_VALIST_REF, va_list_ref_type_node)
82 DEF_PRIMITIVE_TYPE (BT_VALIST_ARG, va_list_arg_type_node)
84 DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID)
85 DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
86 DEF_FUNCTION_TYPE_0 (BT_FN_UNSIGNED, BT_UNSIGNED)
88 DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONG, BT_LONG, BT_LONG)
89 DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGLONG, BT_LONGLONG, BT_LONGLONG)
90 DEF_FUNCTION_TYPE_1 (BT_FN_INTMAX_INTMAX, BT_INTMAX, BT_INTMAX)
91 DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_FLOAT, BT_FLOAT, BT_FLOAT)
92 DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_DOUBLE, BT_DOUBLE, BT_DOUBLE)
93 DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_LONG_DOUBLE,
94 BT_LONG_DOUBLE, BT_LONG_DOUBLE)
95 DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
96 BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
97 DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
98 BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
99 DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
100 BT_COMPLEX_LONG_DOUBLE, BT_COMPLEX_LONG_DOUBLE)
101 DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_COMPLEX_FLOAT,
102 BT_FLOAT, BT_COMPLEX_FLOAT)
103 DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLEX_DOUBLE,
104 BT_DOUBLE, BT_COMPLEX_DOUBLE)
105 DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE_COMPLEX_LONG_DOUBLE,
106 BT_LONG_DOUBLE, BT_COMPLEX_LONG_DOUBLE)
107 DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UNSIGNED, BT_PTR, BT_UNSIGNED)
108 DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE)
109 DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
110 DEF_FUNCTION_TYPE_1 (BT_FN_INT_PTR, BT_INT, BT_PTR)
111 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR)
112 DEF_FUNCTION_TYPE_1 (BT_FN_SIZE_CONST_STRING, BT_SIZE, BT_CONST_STRING)
113 DEF_FUNCTION_TYPE_1 (BT_FN_INT_CONST_STRING, BT_INT, BT_CONST_STRING)
114 DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
115 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VALIST_REF, BT_VOID, BT_VALIST_REF)
116 DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
118 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT)
119 DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING,
120 BT_STRING, BT_STRING, BT_CONST_STRING)
121 DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_CONST_STRING,
122 BT_INT, BT_CONST_STRING, BT_CONST_STRING)
123 DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_CONST_STRING,
124 BT_STRING, BT_CONST_STRING, BT_CONST_STRING)
125 DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_STRING_CONST_STRING,
126 BT_SIZE, BT_CONST_STRING, BT_CONST_STRING)
127 DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_INT,
128 BT_STRING, BT_CONST_STRING, BT_INT)
129 DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_PTR,
130 BT_INT, BT_CONST_STRING, BT_PTR)
131 DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_PTR,
132 BT_INT, BT_INT, BT_PTR)
133 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTRMODE_PTR,
134 BT_VOID, BT_PTRMODE, BT_PTR)
135 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VALIST_REF_VALIST_ARG,
136 BT_VOID, BT_VALIST_REF, BT_VALIST_ARG)
137 DEF_FUNCTION_TYPE_2 (BT_FN_LONG_LONG_LONG,
138 BT_LONG, BT_LONG, BT_LONG)
139 DEF_FUNCTION_TYPE_2 (BT_FN_INT_PTR_CONST_STRING,
140 BT_INT, BT_PTR, BT_CONST_STRING)
141 DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_SIZE,
142 BT_VOID, BT_PTR, BT_SIZE)
144 DEF_FUNCTION_TYPE_3 (BT_FN_STRING_STRING_CONST_STRING_SIZE,
145 BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE)
146 DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
147 BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_SIZE)
148 DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_CONST_PTR_SIZE,
149 BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE)
150 DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
151 BT_INT, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
152 DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_INT_SIZE,
153 BT_PTR, BT_PTR, BT_INT, BT_SIZE)
154 DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_INT_INT, BT_VOID, BT_PTR, BT_INT, BT_INT)
156 DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_PTR,
157 BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_PTR)
159 DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
160 DEF_FUNCTION_TYPE_VAR_0 (BT_FN_INT_VAR, BT_INT)
161 DEF_FUNCTION_TYPE_VAR_0 (BT_FN_PTR_VAR, BT_PTR)
163 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_VALIST_REF_VAR,
164 BT_VOID, BT_VALIST_REF)
165 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_CONST_PTR_VAR,
166 BT_VOID, BT_CONST_PTR)
167 DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR,
168 BT_INT, BT_CONST_STRING)
170 DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_PTR_CONST_STRING_VAR,
171 BT_INT, BT_PTR, BT_CONST_STRING)
173 DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR)
174 DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
175 BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE)