]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/langhooks-def.h
c-common.c (c_expand_expr): Fix prototype.
[thirdparty/gcc.git] / gcc / langhooks-def.h
1 /* Default macros to initialize the lang_hooks data structure.
2 Copyright 2001, 2002 Free Software Foundation, Inc.
3 Contributed by Alexandre Oliva <aoliva@redhat.com>
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 #ifndef GCC_LANG_HOOKS_DEF_H
23 #define GCC_LANG_HOOKS_DEF_H
24
25 /* Provide a hook routine for alias sets that always returns 1. This is
26 used by languages that haven't deal with alias sets yet. */
27 extern HOST_WIDE_INT hook_get_alias_set_0 PARAMS ((tree));
28
29 /* Note to creators of new hooks:
30
31 The macros in this file should NOT be surrounded by a
32 #ifdef...#endif pair, since this file declares the defaults. Each
33 front end overrides any hooks it wishes to, in the file containing
34 its struct lang_hooks, AFTER including this file.
35
36 Prefix all default hooks with "lhd_". */
37
38 /* See langhooks.h for the definition and documentation of each hook. */
39
40 extern void lhd_do_nothing PARAMS ((void));
41 extern void lhd_do_nothing_t PARAMS ((tree));
42 extern int lhd_decode_option PARAMS ((int, char **));
43 extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
44 extern tree lhd_return_tree PARAMS ((tree));
45 extern tree lhd_return_null_tree PARAMS ((tree));
46 extern int lhd_safe_from_p PARAMS ((rtx, tree));
47 extern int lhd_staticp PARAMS ((tree));
48 extern void lhd_clear_binding_stack PARAMS ((void));
49 extern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));
50 extern const char *lhd_decl_printable_name PARAMS ((tree, int));
51 extern void lhd_set_yydebug PARAMS ((int));
52 extern rtx lhd_expand_expr PARAMS ((tree, rtx, enum machine_mode, int));
53
54 /* Declarations of default tree inlining hooks. */
55 tree lhd_tree_inlining_walk_subtrees PARAMS ((tree *, int *,
56 walk_tree_fn,
57 void *, void *));
58 int lhd_tree_inlining_cannot_inline_tree_fn PARAMS ((tree *));
59 int lhd_tree_inlining_disregard_inline_limits PARAMS ((tree));
60 tree lhd_tree_inlining_add_pending_fn_decls PARAMS ((void *, tree));
61 int lhd_tree_inlining_tree_chain_matters_p PARAMS ((tree));
62 int lhd_tree_inlining_auto_var_in_fn_p PARAMS ((tree, tree));
63 tree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree,
64 tree, void *,
65 int *, void *));
66 int lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree));
67 int lhd_tree_inlining_start_inlining PARAMS ((tree));
68 void lhd_tree_inlining_end_inlining PARAMS ((tree));
69 tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
70
71 #define LANG_HOOKS_NAME "GNU unknown"
72 #define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
73 #define LANG_HOOKS_INIT lhd_do_nothing
74 #define LANG_HOOKS_FINISH lhd_do_nothing
75 #define LANG_HOOKS_PARSE_FILE lhd_do_nothing
76 #define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack
77 #define LANG_HOOKS_INIT_OPTIONS lhd_do_nothing
78 #define LANG_HOOKS_DECODE_OPTION lhd_decode_option
79 #define LANG_HOOKS_POST_OPTIONS lhd_do_nothing
80 #define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set
81 #define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree
82 #define LANG_HOOKS_EXPAND_EXPR lhd_expand_expr
83 #define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p
84 #define LANG_HOOKS_STATICP lhd_staticp
85 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
86 #define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
87 #define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
88 #define LANG_HOOKS_MARK_TREE lhd_do_nothing_t
89 #define LANG_HOOKS_HONOR_READONLY false
90 #define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
91 #define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
92 #define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
93 #define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing
94 #define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing
95 #define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
96 #define LANG_HOOKS_SET_YYDEBUG lhd_set_yydebug
97
98 /* Tree inlining hooks. */
99 #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees
100 #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
101 lhd_tree_inlining_cannot_inline_tree_fn
102 #define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
103 lhd_tree_inlining_disregard_inline_limits
104 #define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
105 lhd_tree_inlining_add_pending_fn_decls
106 #define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
107 lhd_tree_inlining_tree_chain_matters_p
108 #define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
109 lhd_tree_inlining_auto_var_in_fn_p
110 #define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
111 lhd_tree_inlining_copy_res_decl_for_inlining
112 #define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
113 lhd_tree_inlining_anon_aggr_type_p
114 #define LANG_HOOKS_TREE_INLINING_START_INLINING \
115 lhd_tree_inlining_start_inlining
116 #define LANG_HOOKS_TREE_INLINING_END_INLINING \
117 lhd_tree_inlining_end_inlining
118 #define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
119 lhd_tree_inlining_convert_parm_for_inlining
120
121 #define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
122 LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
123 LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
124 LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
125 LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, \
126 LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, \
127 LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
128 LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \
129 LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \
130 LANG_HOOKS_TREE_INLINING_START_INLINING, \
131 LANG_HOOKS_TREE_INLINING_END_INLINING, \
132 LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
133 } \
134
135 /* Tree dump hooks. */
136 int lhd_tree_dump_dump_tree PARAMS ((void *, tree));
137 int lhd_tree_dump_type_quals PARAMS ((tree));
138
139 #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
140 #define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
141
142 #define LANG_HOOKS_TREE_DUMP_INITIALIZER { \
143 LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \
144 LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
145 }
146
147 /* Declaration hooks. */
148 #define LANG_HOOKS_PUSHLEVEL pushlevel
149 #define LANG_HOOKS_POPLEVEL poplevel
150 #define LANG_HOOKS_GLOBAL_BINDINGS_P global_bindings_p
151 #define LANG_HOOKS_INSERT_BLOCK insert_block
152 #define LANG_HOOKS_SET_BLOCK set_block
153 #define LANG_HOOKS_PUSHDECL pushdecl
154 #define LANG_HOOKS_GETDECLS getdecls
155
156 #define LANG_HOOKS_DECLS { \
157 LANG_HOOKS_PUSHLEVEL, \
158 LANG_HOOKS_POPLEVEL, \
159 LANG_HOOKS_GLOBAL_BINDINGS_P, \
160 LANG_HOOKS_INSERT_BLOCK, \
161 LANG_HOOKS_SET_BLOCK, \
162 LANG_HOOKS_PUSHDECL, \
163 LANG_HOOKS_GETDECLS \
164 }
165
166 /* The whole thing. The structure is defined in langhooks.h. */
167 #define LANG_HOOKS_INITIALIZER { \
168 LANG_HOOKS_NAME, \
169 LANG_HOOKS_IDENTIFIER_SIZE, \
170 LANG_HOOKS_INIT_OPTIONS, \
171 LANG_HOOKS_DECODE_OPTION, \
172 LANG_HOOKS_POST_OPTIONS, \
173 LANG_HOOKS_INIT, \
174 LANG_HOOKS_FINISH, \
175 LANG_HOOKS_PARSE_FILE, \
176 LANG_HOOKS_CLEAR_BINDING_STACK, \
177 LANG_HOOKS_GET_ALIAS_SET, \
178 LANG_HOOKS_EXPAND_CONSTANT, \
179 LANG_HOOKS_EXPAND_EXPR, \
180 LANG_HOOKS_SAFE_FROM_P, \
181 LANG_HOOKS_STATICP, \
182 LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
183 LANG_HOOKS_UNSAVE_EXPR_NOW, \
184 LANG_HOOKS_MAYBE_BUILD_CLEANUP, \
185 LANG_HOOKS_MARK_TREE, \
186 LANG_HOOKS_HONOR_READONLY, \
187 LANG_HOOKS_PRINT_STATISTICS, \
188 LANG_HOOKS_PRINT_XNODE, \
189 LANG_HOOKS_PRINT_DECL, \
190 LANG_HOOKS_PRINT_TYPE, \
191 LANG_HOOKS_PRINT_IDENTIFIER, \
192 LANG_HOOKS_DECL_PRINTABLE_NAME, \
193 LANG_HOOKS_SET_YYDEBUG, \
194 LANG_HOOKS_TREE_INLINING_INITIALIZER, \
195 LANG_HOOKS_TREE_DUMP_INITIALIZER, \
196 LANG_HOOKS_DECLS \
197 }
198
199 #endif /* GCC_LANG_HOOKS_DEF_H */