]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/langhooks-def.h
Change copyright header to refer to version 3 of the GNU General Public License and...
[thirdparty/gcc.git] / gcc / langhooks-def.h
CommitLineData
d23c55c2 1/* Default macros to initialize the lang_hooks data structure.
08f0e79e 2 Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 8it under the terms of the GNU General Public License as published by
9dcd6f09 9the Free Software Foundation; either version 3, or (at your option)
d23c55c2
NB
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
9dcd6f09
NC
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
d23c55c2
NB
20
21#ifndef GCC_LANG_HOOKS_DEF_H
22#define GCC_LANG_HOOKS_DEF_H
23
e5f3b786
NB
24#include "hooks.h"
25
7cb32822
NB
26struct diagnostic_context;
27
d23c55c2
NB
28/* Note to creators of new hooks:
29
30 The macros in this file should NOT be surrounded by a
31 #ifdef...#endif pair, since this file declares the defaults. Each
32 front end overrides any hooks it wishes to, in the file containing
7fb26bb0 33 its struct lang_hooks, AFTER including this file. */
d23c55c2
NB
34
35/* See langhooks.h for the definition and documentation of each hook. */
36
0c20a65f
AJ
37extern void lhd_do_nothing (void);
38extern void lhd_do_nothing_t (tree);
39extern void lhd_do_nothing_i (int);
40extern void lhd_do_nothing_f (struct function *);
41extern bool lhd_post_options (const char **);
42extern HOST_WIDE_INT lhd_get_alias_set (tree);
43extern tree lhd_return_tree (tree);
47aa0df4 44extern tree lhd_return_null_tree_v (void);
0c20a65f 45extern tree lhd_return_null_tree (tree);
a7e8c268 46extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
270c60bb 47extern tree lhd_staticp (tree);
0c20a65f
AJ
48extern void lhd_print_tree_nothing (FILE *, tree, int);
49extern const char *lhd_decl_printable_name (tree, int);
721a8ac5 50extern const char *lhd_dwarf_name (tree, int);
6de9cd9a 51extern int lhd_types_compatible_p (tree, tree);
0fab64a3 52extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
6de9cd9a 53extern int lhd_expand_decl (tree);
0c20a65f
AJ
54extern void lhd_print_error_function (struct diagnostic_context *,
55 const char *);
56extern void lhd_set_decl_assembler_name (tree);
0c20a65f
AJ
57extern bool lhd_warn_unused_global_decl (tree);
58extern void lhd_incomplete_type_error (tree, tree);
59extern tree lhd_type_promotes_to (tree);
9649812a 60extern void lhd_register_builtin_type (tree, const char *);
0c20a65f 61extern bool lhd_decl_ok_for_sibcall (tree);
c18a5b6c 62extern const char *lhd_comdat_group (tree);
0c20a65f
AJ
63extern tree lhd_expr_size (tree);
64extern size_t lhd_tree_size (enum tree_code);
c5ff069d 65extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
73f397d4 66extern tree lhd_expr_to_decl (tree, bool *, bool *, bool *);
c79efc4d 67extern tree lhd_builtin_function (tree decl);
d23c55c2
NB
68
69/* Declarations of default tree inlining hooks. */
0c20a65f 70extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
0c58f841 71 void *, struct pointer_set_t*);
0c20a65f
AJ
72extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *);
73extern int lhd_tree_inlining_disregard_inline_limits (tree);
0c20a65f 74extern int lhd_tree_inlining_auto_var_in_fn_p (tree, tree);
21ecc5a7 75extern void lhd_initialize_diagnostics (struct diagnostic_context *);
25c84396
RH
76extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
77
0c20a65f 78
6de9cd9a
DN
79/* Declarations for tree gimplification hooks. */
80extern int lhd_gimplify_expr (tree *, tree *, tree *);
953ff289
DN
81extern enum omp_clause_default_kind lhd_omp_predetermined_sharing (tree);
82extern tree lhd_omp_assignment (tree, tree, tree);
83struct gimplify_omp_ctx;
84extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
85 tree);
6de9cd9a 86
3ac88239
NB
87#define LANG_HOOKS_NAME "GNU unknown"
88#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
4bfec483 89#define LANG_HOOKS_INIT hook_bool_void_false
d23c55c2 90#define LANG_HOOKS_FINISH lhd_do_nothing
ff45c01e 91#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
9dcf6e73 92#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_do_nothing
b86f6cd9 93#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
fc95cf70 94#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS lhd_initialize_diagnostics
b86f6cd9 95#define LANG_HOOKS_HANDLE_OPTION hook_int_size_t_constcharptr_int_0
cb66e385 96#define LANG_HOOKS_MISSING_ARGUMENT hook_bool_constcharptr_size_t_false
4bfec483 97#define LANG_HOOKS_POST_OPTIONS lhd_post_options
d23c55c2 98#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
ac79cd5a 99#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
c9d892a8 100#define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
6de9cd9a 101#define LANG_HOOKS_EXPAND_DECL lhd_expand_decl
48a7a235 102#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
270c60bb 103#define LANG_HOOKS_STATICP lhd_staticp
63e1b1c4 104#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
599bba86 105#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
bc15d0ef 106#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS false
2896d056 107#define LANG_HOOKS_NO_BODY_BLOCKS false
5d69f816
NB
108#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
109#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
110#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
111#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing
112#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing
7cb32822 113#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
7afff7cf 114#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
721a8ac5 115#define LANG_HOOKS_DWARF_NAME lhd_dwarf_name
83d865c5 116#define LANG_HOOKS_GET_CALLEE_FNDECL lhd_return_null_tree
a77a9a18 117#define LANG_HOOKS_EXPR_SIZE lhd_expr_size
d78e771d 118#define LANG_HOOKS_TREE_SIZE lhd_tree_size
6de9cd9a 119#define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p
c79efc4d 120#define LANG_HOOKS_BUILTIN_FUNCTION lhd_builtin_function
73f397d4 121#define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl
c5ff069d 122#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset
820cc88f 123#define LANG_HOOKS_INIT_TS lhd_do_nothing
d23c55c2 124
b03e38e1 125#define LANG_HOOKS_FUNCTION_INIT lhd_do_nothing_f
e2500fed 126#define LANG_HOOKS_FUNCTION_FINAL lhd_do_nothing_f
b03e38e1
NB
127#define LANG_HOOKS_FUNCTION_ENTER_NESTED lhd_do_nothing_f
128#define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
6de9cd9a 129#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P hook_bool_tree_true
4985cde3 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
d23c55c2
NB
142#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
143 lhd_tree_inlining_auto_var_in_fn_p
8bcefb43 144#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
5377d5ba 145 hook_bool_tree_tree_false
d23c55c2
NB
146
147#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
148 LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
149 LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
150 LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
d23c55c2 151 LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
8bcefb43 152 LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \
25c84396 153}
d23c55c2 154
25c84396 155#define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR lhd_callgraph_analyze_expr
e72fcfe8
JH
156#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION NULL
157
158#define LANG_HOOKS_CALLGRAPH_INITIALIZER { \
25c84396 159 LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, \
e72fcfe8 160 LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, \
25c84396 161}
e72fcfe8 162
e2500fed
GK
163#define LANG_HOOKS_FUNCTION_INITIALIZER { \
164 LANG_HOOKS_FUNCTION_INIT, \
165 LANG_HOOKS_FUNCTION_FINAL, \
166 LANG_HOOKS_FUNCTION_ENTER_NESTED, \
6de9cd9a
DN
167 LANG_HOOKS_FUNCTION_LEAVE_NESTED, \
168 LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P \
b03e38e1
NB
169}
170
6de9cd9a
DN
171/* Hooks for tree gimplification. */
172#define LANG_HOOKS_GIMPLIFY_EXPR lhd_gimplify_expr
0f59171d 173#define LANG_HOOKS_FOLD_OBJ_TYPE_REF NULL
4985cde3 174
89d684bb 175/* Tree dump hooks. */
0c20a65f
AJ
176extern bool lhd_tree_dump_dump_tree (void *, tree);
177extern int lhd_tree_dump_type_quals (tree);
b9dcdee4 178extern tree lhd_make_node (enum tree_code);
89d684bb
BM
179
180#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
181#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
182
183#define LANG_HOOKS_TREE_DUMP_INITIALIZER { \
184 LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \
185 LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
43577e6b
NB
186}
187
48a7a235
NB
188/* Types hooks. There are no reasonable defaults for most of them,
189 so we create a compile-time error instead. */
b9dcdee4 190#define LANG_HOOKS_MAKE_TYPE lhd_make_node
7a228918 191#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
39ef6592 192#define LANG_HOOKS_GENERIC_TYPE_P hook_bool_tree_false
ab393bf1 193#define LANG_HOOKS_TYPE_PROMOTES_TO lhd_type_promotes_to
9649812a 194#define LANG_HOOKS_REGISTER_BUILTIN_TYPE lhd_register_builtin_type
8963a517 195#define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_tree
953ff289
DN
196#define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES \
197 lhd_omp_firstprivatize_type_sizes
7548281d 198#define LANG_HOOKS_HASH_TYPES true
f1e639b1
NB
199
200#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
b0c48229
NB
201 LANG_HOOKS_MAKE_TYPE, \
202 LANG_HOOKS_TYPE_FOR_MODE, \
ceef8ce4 203 LANG_HOOKS_TYPE_FOR_SIZE, \
39ef6592 204 LANG_HOOKS_GENERIC_TYPE_P, \
ab393bf1 205 LANG_HOOKS_TYPE_PROMOTES_TO, \
9649812a 206 LANG_HOOKS_REGISTER_BUILTIN_TYPE, \
7548281d 207 LANG_HOOKS_INCOMPLETE_TYPE_ERROR, \
8963a517 208 LANG_HOOKS_TYPE_MAX_SIZE, \
953ff289 209 LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES, \
7548281d 210 LANG_HOOKS_HASH_TYPES \
f1e639b1
NB
211}
212
43577e6b 213/* Declaration hooks. */
43577e6b
NB
214#define LANG_HOOKS_GLOBAL_BINDINGS_P global_bindings_p
215#define LANG_HOOKS_INSERT_BLOCK insert_block
43577e6b
NB
216#define LANG_HOOKS_PUSHDECL pushdecl
217#define LANG_HOOKS_GETDECLS getdecls
ef4f94ac 218#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL lhd_warn_unused_global_decl
2b59501b 219#define LANG_HOOKS_WRITE_GLOBALS write_global_declarations
e076f71a 220#define LANG_HOOKS_DECL_OK_FOR_SIBCALL lhd_decl_ok_for_sibcall
c18a5b6c 221#define LANG_HOOKS_COMDAT_GROUP lhd_comdat_group
953ff289
DN
222#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE hook_bool_tree_false
223#define LANG_HOOKS_OMP_PREDETERMINED_SHARING lhd_omp_predetermined_sharing
224#define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR hook_bool_tree_bool_false
225#define LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE hook_bool_tree_bool_false
226#define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR hook_tree_tree_tree_null
227#define LANG_HOOKS_OMP_CLAUSE_COPY_CTOR lhd_omp_assignment
228#define LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP lhd_omp_assignment
229#define LANG_HOOKS_OMP_CLAUSE_DTOR hook_tree_tree_tree_null
43577e6b
NB
230
231#define LANG_HOOKS_DECLS { \
43577e6b
NB
232 LANG_HOOKS_GLOBAL_BINDINGS_P, \
233 LANG_HOOKS_INSERT_BLOCK, \
43577e6b 234 LANG_HOOKS_PUSHDECL, \
ef4f94ac 235 LANG_HOOKS_GETDECLS, \
2b59501b 236 LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, \
e076f71a
AH
237 LANG_HOOKS_WRITE_GLOBALS, \
238 LANG_HOOKS_DECL_OK_FOR_SIBCALL, \
953ff289
DN
239 LANG_HOOKS_COMDAT_GROUP, \
240 LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, \
241 LANG_HOOKS_OMP_PREDETERMINED_SHARING, \
242 LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, \
243 LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, \
244 LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, \
245 LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, \
246 LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, \
247 LANG_HOOKS_OMP_CLAUSE_DTOR \
43577e6b 248}
89d684bb
BM
249
250/* The whole thing. The structure is defined in langhooks.h. */
d23c55c2 251#define LANG_HOOKS_INITIALIZER { \
3ac88239
NB
252 LANG_HOOKS_NAME, \
253 LANG_HOOKS_IDENTIFIER_SIZE, \
d78e771d 254 LANG_HOOKS_TREE_SIZE, \
d23c55c2 255 LANG_HOOKS_INIT_OPTIONS, \
fc95cf70 256 LANG_HOOKS_INITIALIZE_DIAGNOSTICS, \
2772ef3e 257 LANG_HOOKS_HANDLE_OPTION, \
cb66e385 258 LANG_HOOKS_MISSING_ARGUMENT, \
d23c55c2 259 LANG_HOOKS_POST_OPTIONS, \
4d6baafa
NB
260 LANG_HOOKS_INIT, \
261 LANG_HOOKS_FINISH, \
52dabb6c 262 LANG_HOOKS_PARSE_FILE, \
4d6baafa 263 LANG_HOOKS_CLEAR_BINDING_STACK, \
d23c55c2 264 LANG_HOOKS_GET_ALIAS_SET, \
ac79cd5a 265 LANG_HOOKS_EXPAND_CONSTANT, \
c9d892a8 266 LANG_HOOKS_EXPAND_EXPR, \
6de9cd9a 267 LANG_HOOKS_EXPAND_DECL, \
48a7a235 268 LANG_HOOKS_FINISH_INCOMPLETE_DECL, \
dffd7eb6 269 LANG_HOOKS_MARK_ADDRESSABLE, \
270c60bb 270 LANG_HOOKS_STATICP, \
63e1b1c4 271 LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
599bba86 272 LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
bc15d0ef 273 LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
2896d056 274 LANG_HOOKS_NO_BODY_BLOCKS, \
5d69f816
NB
275 LANG_HOOKS_PRINT_STATISTICS, \
276 LANG_HOOKS_PRINT_XNODE, \
277 LANG_HOOKS_PRINT_DECL, \
278 LANG_HOOKS_PRINT_TYPE, \
279 LANG_HOOKS_PRINT_IDENTIFIER, \
7afff7cf 280 LANG_HOOKS_DECL_PRINTABLE_NAME, \
721a8ac5 281 LANG_HOOKS_DWARF_NAME, \
6de9cd9a 282 LANG_HOOKS_TYPES_COMPATIBLE_P, \
83d865c5 283 LANG_HOOKS_GET_CALLEE_FNDECL, \
7cb32822 284 LANG_HOOKS_PRINT_ERROR_FUNCTION, \
a77a9a18 285 LANG_HOOKS_EXPR_SIZE, \
c5ff069d 286 LANG_HOOKS_TO_TARGET_CHARSET, \
349ae713
NB
287 LANG_HOOKS_ATTRIBUTE_TABLE, \
288 LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
289 LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
b03e38e1 290 LANG_HOOKS_FUNCTION_INITIALIZER, \
89d684bb 291 LANG_HOOKS_TREE_INLINING_INITIALIZER, \
e72fcfe8 292 LANG_HOOKS_CALLGRAPH_INITIALIZER, \
43577e6b 293 LANG_HOOKS_TREE_DUMP_INITIALIZER, \
f1e639b1 294 LANG_HOOKS_DECLS, \
4985cde3 295 LANG_HOOKS_FOR_TYPES_INITIALIZER, \
6de9cd9a 296 LANG_HOOKS_GIMPLIFY_EXPR, \
0f59171d 297 LANG_HOOKS_FOLD_OBJ_TYPE_REF, \
6e34d3a3 298 LANG_HOOKS_BUILTIN_FUNCTION, \
820cc88f 299 LANG_HOOKS_INIT_TS, \
73f397d4 300 LANG_HOOKS_EXPR_TO_DECL, \
d23c55c2
NB
301}
302
303#endif /* GCC_LANG_HOOKS_DEF_H */