]> gcc.gnu.org Git - gcc.git/blame - gcc/langhooks-def.h
acconfig.h (__NO_MATH_INLINES): Removed.
[gcc.git] / gcc / langhooks-def.h
CommitLineData
d23c55c2 1/* Default macros to initialize the lang_hooks data structure.
0c20a65f 2 Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
d23c55c2
NB
3 Contributed by Alexandre Oliva <aoliva@redhat.com>
4
63b025a5 5This file is part of GCC.
d23c55c2 6
63b025a5 7GCC is free software; you can redistribute it and/or modify
d23c55c2
NB
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
63b025a5 12GCC is distributed in the hope that it will be useful,
d23c55c2
NB
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
63b025a5 18along with GCC; see the file COPYING. If not, write to
d23c55c2
NB
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22#ifndef GCC_LANG_HOOKS_DEF_H
23#define GCC_LANG_HOOKS_DEF_H
24
e5f3b786
NB
25#include "hooks.h"
26
7cb32822
NB
27struct diagnostic_context;
28
d23c55c2
NB
29/* Provide a hook routine for alias sets that always returns 1. This is
30 used by languages that haven't deal with alias sets yet. */
0c20a65f 31extern HOST_WIDE_INT hook_get_alias_set_0 (tree);
d23c55c2
NB
32
33/* Note to creators of new hooks:
34
35 The macros in this file should NOT be surrounded by a
36 #ifdef...#endif pair, since this file declares the defaults. Each
37 front end overrides any hooks it wishes to, in the file containing
7fb26bb0 38 its struct lang_hooks, AFTER including this file. */
d23c55c2
NB
39
40/* See langhooks.h for the definition and documentation of each hook. */
41
0c20a65f
AJ
42extern void lhd_do_nothing (void);
43extern void lhd_do_nothing_t (tree);
44extern void lhd_do_nothing_i (int);
45extern void lhd_do_nothing_f (struct function *);
46extern bool lhd_post_options (const char **);
47extern HOST_WIDE_INT lhd_get_alias_set (tree);
48extern tree lhd_return_tree (tree);
49extern tree lhd_return_null_tree (tree);
50extern int lhd_safe_from_p (rtx, tree);
51extern int lhd_staticp (tree);
52extern int lhd_unsafe_for_reeval (tree);
53extern void lhd_clear_binding_stack (void);
54extern void lhd_print_tree_nothing (FILE *, tree, int);
55extern const char *lhd_decl_printable_name (tree, int);
56extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int);
57extern void lhd_print_error_function (struct diagnostic_context *,
58 const char *);
59extern void lhd_set_decl_assembler_name (tree);
60extern bool lhd_can_use_bit_fields_p (void);
61extern bool lhd_warn_unused_global_decl (tree);
62extern void lhd_incomplete_type_error (tree, tree);
63extern tree lhd_type_promotes_to (tree);
9649812a 64extern void lhd_register_builtin_type (tree, const char *);
0c20a65f
AJ
65extern bool lhd_decl_ok_for_sibcall (tree);
66extern tree lhd_expr_size (tree);
16b0d23f 67extern bool lhd_decl_uninit (tree);
0c20a65f 68extern size_t lhd_tree_size (enum tree_code);
d23c55c2
NB
69
70/* Declarations of default tree inlining hooks. */
0c20a65f
AJ
71extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
72 void *, void *);
73extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *);
74extern int lhd_tree_inlining_disregard_inline_limits (tree);
75extern tree lhd_tree_inlining_add_pending_fn_decls (void *, tree);
76extern int lhd_tree_inlining_tree_chain_matters_p (tree);
77extern int lhd_tree_inlining_auto_var_in_fn_p (tree, tree);
78extern tree lhd_tree_inlining_copy_res_decl_for_inlining (tree, tree, tree,
79 void *, int *, tree);
80extern int lhd_tree_inlining_anon_aggr_type_p (tree);
81extern int lhd_tree_inlining_start_inlining (tree);
82extern void lhd_tree_inlining_end_inlining (tree);
83extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
21ecc5a7 84extern void lhd_initialize_diagnostics (struct diagnostic_context *);
0c20a65f 85
3ac88239
NB
86#define LANG_HOOKS_NAME "GNU unknown"
87#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
4bfec483 88#define LANG_HOOKS_INIT hook_bool_void_false
d23c55c2 89#define LANG_HOOKS_FINISH lhd_do_nothing
ff45c01e 90#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
d23c55c2 91#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
b86f6cd9 92#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
fc95cf70 93#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
b86f6cd9 94#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
cb66e385 95#define LANG_HOOKS_MISSING_ARGUMENT hook_bool_constcharptr_size_t_false
4bfec483 96#define LANG_HOOKS_POST_OPTIONS lhd_post_options
d23c55c2 97#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
ac79cd5a 98#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
c9d892a8 99#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
ac79cd5a 100#define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p
48a7a235
NB
101#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
102#define LANG_HOOKS_UNSAFE_FOR_REEVAL lhd_unsafe_for_reeval
d062a680 103#define LANG_HOOKS_STATICP lhd_staticp
63e1b1c4 104#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
24965e7a 105#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
c88770e9 106#define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
599bba86 107#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
57ce46bb 108#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P lhd_can_use_bit_fields_p
d23c55c2 109#define LANG_HOOKS_HONOR_READONLY false
2896d056 110#define LANG_HOOKS_NO_BODY_BLOCKS false
5d69f816
NB
111#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
112#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
113#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
114#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing
115#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing
7cb32822 116#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
7afff7cf 117#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
a77a9a18 118#define LANG_HOOKS_EXPR_SIZE lhd_expr_size
16b0d23f 119#define LANG_HOOKS_DECL_UNINIT lhd_decl_uninit
d78e771d 120#define LANG_HOOKS_TREE_SIZE lhd_tree_size
d23c55c2 121
b03e38e1 122#define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f
e2500fed 123#define LANG_HOOKS_FUNCTION_FINAL lhd_do_nothing_f
b03e38e1
NB
124#define LANG_HOOKS_FUNCTION_ENTER_NESTED lhd_do_nothing_f
125#define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
b03e38e1 126
4985cde3 127#define LANG_HOOKS_RTL_EXPAND_START lhd_do_nothing
27f35b75 128#define LANG_HOOKS_RTL_EXPAND_STMT (void (*) (tree)) abort
4985cde3
RH
129#define LANG_HOOKS_RTL_EXPAND_END lhd_do_nothing
130
349ae713
NB
131/* Attribute hooks. */
132#define LANG_HOOKS_ATTRIBUTE_TABLE NULL
133#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE NULL
134#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE NULL
135
d23c55c2
NB
136/* Tree inlining hooks. */
137#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees
138#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
139 lhd_tree_inlining_cannot_inline_tree_fn
140#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
141 lhd_tree_inlining_disregard_inline_limits
142#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
143 lhd_tree_inlining_add_pending_fn_decls
144#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
145 lhd_tree_inlining_tree_chain_matters_p
146#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
147 lhd_tree_inlining_auto_var_in_fn_p
148#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
149 lhd_tree_inlining_copy_res_decl_for_inlining
150#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
151 lhd_tree_inlining_anon_aggr_type_p
8bcefb43 152#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
7b1bd3c5 153 hook_bool_tree_false
742a37d5
JM
154#define LANG_HOOKS_TREE_INLINING_START_INLINING \
155 lhd_tree_inlining_start_inlining
156#define LANG_HOOKS_TREE_INLINING_END_INLINING \
157 lhd_tree_inlining_end_inlining
f735a153
JJ
158#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
159 lhd_tree_inlining_convert_parm_for_inlining
084c1779
JH
160#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \
161 NULL
d23c55c2
NB
162
163#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
164 LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
165 LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
166 LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
167 LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, \
168 LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, \
169 LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
170 LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \
742a37d5 171 LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \
8bcefb43 172 LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \
742a37d5 173 LANG_HOOKS_TREE_INLINING_START_INLINING, \
f735a153 174 LANG_HOOKS_TREE_INLINING_END_INLINING, \
084c1779
JH
175 LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING, \
176 LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS \
d23c55c2
NB
177} \
178
e72fcfe8
JH
179#define LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION NULL
180#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION NULL
181
182#define LANG_HOOKS_CALLGRAPH_INITIALIZER { \
183 LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION, \
184 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, \
185} \
186
e2500fed
GK
187#define LANG_HOOKS_FUNCTION_INITIALIZER { \
188 LANG_HOOKS_FUNCTION_INIT, \
189 LANG_HOOKS_FUNCTION_FINAL, \
190 LANG_HOOKS_FUNCTION_ENTER_NESTED, \
191 LANG_HOOKS_FUNCTION_LEAVE_NESTED \
b03e38e1
NB
192}
193
4985cde3
RH
194#define LANG_HOOKS_RTL_EXPAND_INITIALIZER { \
195 LANG_HOOKS_RTL_EXPAND_START, \
196 LANG_HOOKS_RTL_EXPAND_STMT, \
197 LANG_HOOKS_RTL_EXPAND_END \
198}
199
89d684bb 200/* Tree dump hooks. */
0c20a65f
AJ
201extern bool lhd_tree_dump_dump_tree (void *, tree);
202extern int lhd_tree_dump_type_quals (tree);
89d684bb
BM
203
204#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
205#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
206
207#define LANG_HOOKS_TREE_DUMP_INITIALIZER { \
208 LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \
209 LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
43577e6b
NB
210}
211
48a7a235
NB
212/* Types hooks. There are no reasonable defaults for most of them,
213 so we create a compile-time error instead. */
f1e639b1 214#define LANG_HOOKS_MAKE_TYPE make_node
7a228918 215#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
ab393bf1 216#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
9649812a 217#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
f1e639b1
NB
218
219#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
b0c48229
NB
220 LANG_HOOKS_MAKE_TYPE, \
221 LANG_HOOKS_TYPE_FOR_MODE, \
ceef8ce4
NB
222 LANG_HOOKS_TYPE_FOR_SIZE, \
223 LANG_HOOKS_UNSIGNED_TYPE, \
224 LANG_HOOKS_SIGNED_TYPE, \
7a228918 225 LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
ab393bf1 226 LANG_HOOKS_TYPE_PROMOTES_TO, \
9649812a 227 LANG_HOOKS_REGISTER_BUILTIN_TYPE, \
7a228918 228 LANG_HOOKS_INCOMPLETE_TYPE_ERROR \
f1e639b1
NB
229}
230
43577e6b
NB
231/* Declaration hooks. */
232#define LANG_HOOKS_PUSHLEVEL pushlevel
233#define LANG_HOOKS_POPLEVEL poplevel
234#define LANG_HOOKS_GLOBAL_BINDINGS_P global_bindings_p
235#define LANG_HOOKS_INSERT_BLOCK insert_block
236#define LANG_HOOKS_SET_BLOCK set_block
237#define LANG_HOOKS_PUSHDECL pushdecl
238#define LANG_HOOKS_GETDECLS getdecls
ef4f94ac 239#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
2b59501b 240#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
d35543c0 241#define LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE NULL
e076f71a 242#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
43577e6b
NB
243
244#define LANG_HOOKS_DECLS { \
245 LANG_HOOKS_PUSHLEVEL, \
246 LANG_HOOKS_POPLEVEL, \
247 LANG_HOOKS_GLOBAL_BINDINGS_P, \
248 LANG_HOOKS_INSERT_BLOCK, \
249 LANG_HOOKS_SET_BLOCK, \
250 LANG_HOOKS_PUSHDECL, \
ef4f94ac 251 LANG_HOOKS_GETDECLS, \
2b59501b 252 LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
e076f71a 253 LANG_HOOKS_WRITE_GLOBALS, \
d35543c0 254 LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE, \
e076f71a 255 LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
43577e6b 256}
89d684bb
BM
257
258/* The whole thing. The structure is defined in langhooks.h. */
d23c55c2 259#define LANG_HOOKS_INITIALIZER { \
3ac88239
NB
260 LANG_HOOKS_NAME, \
261 LANG_HOOKS_IDENTIFIER_SIZE, \
d78e771d 262 LANG_HOOKS_TREE_SIZE, \
d23c55c2 263 LANG_HOOKS_INIT_OPTIONS, \
fc95cf70 264 LANG_HOOKS_INITIALIZE_DIAGNOSTICS, \
2772ef3e 265 LANG_HOOKS_HANDLE_OPTION, \
cb66e385 266 LANG_HOOKS_MISSING_ARGUMENT, \
d23c55c2 267 LANG_HOOKS_POST_OPTIONS, \
4d6baafa
NB
268 LANG_HOOKS_INIT, \
269 LANG_HOOKS_FINISH, \
52dabb6c 270 LANG_HOOKS_PARSE_FILE, \
4d6baafa 271 LANG_HOOKS_CLEAR_BINDING_STACK, \
d23c55c2 272 LANG_HOOKS_GET_ALIAS_SET, \
ac79cd5a 273 LANG_HOOKS_EXPAND_CONSTANT, \
c9d892a8 274 LANG_HOOKS_EXPAND_EXPR, \
78ef5b89 275 LANG_HOOKS_TRUTHVALUE_CONVERSION, \
ac79cd5a 276 LANG_HOOKS_SAFE_FROM_P, \
48a7a235
NB
277 LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
278 LANG_HOOKS_UNSAFE_FOR_REEVAL, \
dffd7eb6 279 LANG_HOOKS_MARK_ADDRESSABLE, \
d062a680 280 LANG_HOOKS_STATICP, \
63e1b1c4 281 LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
24965e7a 282 LANG_HOOKS_UNSAVE_EXPR_NOW, \
c88770e9 283 LANG_HOOKS_MAYBE_BUILD_CLEANUP, \
599bba86 284 LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
57ce46bb 285 LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
d23c55c2 286 LANG_HOOKS_HONOR_READONLY, \
2896d056 287 LANG_HOOKS_NO_BODY_BLOCKS, \
5d69f816
NB
288 LANG_HOOKS_PRINT_STATISTICS, \
289 LANG_HOOKS_PRINT_XNODE, \
290 LANG_HOOKS_PRINT_DECL, \
291 LANG_HOOKS_PRINT_TYPE, \
292 LANG_HOOKS_PRINT_IDENTIFIER, \
7afff7cf 293 LANG_HOOKS_DECL_PRINTABLE_NAME, \
7cb32822 294 LANG_HOOKS_PRINT_ERROR_FUNCTION, \
a77a9a18 295 LANG_HOOKS_EXPR_SIZE, \
16b0d23f 296 LANG_HOOKS_DECL_UNINIT, \
349ae713
NB
297 LANG_HOOKS_ATTRIBUTE_TABLE, \
298 LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
299 LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
b03e38e1 300 LANG_HOOKS_FUNCTION_INITIALIZER, \
89d684bb 301 LANG_HOOKS_TREE_INLINING_INITIALIZER, \
e72fcfe8 302 LANG_HOOKS_CALLGRAPH_INITIALIZER, \
43577e6b 303 LANG_HOOKS_TREE_DUMP_INITIALIZER, \
f1e639b1 304 LANG_HOOKS_DECLS, \
4985cde3
RH
305 LANG_HOOKS_FOR_TYPES_INITIALIZER, \
306 LANG_HOOKS_RTL_EXPAND_INITIALIZER \
d23c55c2
NB
307}
308
309#endif /* GCC_LANG_HOOKS_DEF_H */
This page took 8.297402 seconds and 5 git commands to generate.