langhooks-def.h revision 96263
190075Sobrien/* Default macros to initialize the lang_hooks data structure.
290075Sobrien   Copyright 2001 Free Software Foundation, Inc.
390075Sobrien   Contributed by Alexandre Oliva  <aoliva@redhat.com>
490075Sobrien
590075SobrienThis file is part of GNU CC.
690075Sobrien
790075SobrienGNU CC is free software; you can redistribute it and/or modify
890075Sobrienit under the terms of the GNU General Public License as published by
990075Sobrienthe Free Software Foundation; either version 2, or (at your option)
1090075Sobrienany later version.
1190075Sobrien
1290075SobrienGNU CC is distributed in the hope that it will be useful,
1390075Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1490075SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1590075SobrienGNU General Public License for more details.
1690075Sobrien
1790075SobrienYou should have received a copy of the GNU General Public License
1890075Sobrienalong with GNU CC; see the file COPYING.  If not, write to
1990075Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
2090075SobrienBoston, MA 02111-1307, USA.  */
2190075Sobrien
2290075Sobrien#ifndef GCC_LANG_HOOKS_DEF_H
2390075Sobrien#define GCC_LANG_HOOKS_DEF_H
2490075Sobrien
2590075Sobrien/* Provide a hook routine for alias sets that always returns 1.  This is
2690075Sobrien   used by languages that haven't deal with alias sets yet.  */
2790075Sobrienextern HOST_WIDE_INT hook_get_alias_set_0	PARAMS ((tree));
2890075Sobrien
2990075Sobrien/* Note to creators of new hooks:
3090075Sobrien
3190075Sobrien   The macros in this file should NOT be surrounded by a
3290075Sobrien   #ifdef...#endif pair, since this file declares the defaults.  Each
3390075Sobrien   front end overrides any hooks it wishes to, in the file containing
3490075Sobrien   its struct lang_hooks, AFTER including this file.
3590075Sobrien
3690075Sobrien   Prefix all default hooks with "lhd_".  */
3790075Sobrien
3890075Sobrien/* See langhooks.h for the definition and documentation of each hook.  */
3990075Sobrien
4090075Sobrienextern void lhd_do_nothing PARAMS ((void));
4190075Sobrienextern int lhd_decode_option PARAMS ((int, char **));
4290075Sobrienextern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
4390075Sobrienextern tree lhd_return_tree PARAMS ((tree));
4490075Sobrienextern int lhd_safe_from_p PARAMS ((rtx, tree));
4590075Sobrienextern int lhd_staticp PARAMS ((tree));
4690075Sobrienextern void lhd_clear_binding_stack PARAMS ((void));
4790075Sobrienextern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));
4890075Sobrienextern void lhd_set_yydebug PARAMS ((int));
4990075Sobrien
5090075Sobrien/* Declarations of default tree inlining hooks.  */
5190075Sobrientree lhd_tree_inlining_walk_subtrees		PARAMS ((tree *, int *,
5290075Sobrien							 walk_tree_fn,
5390075Sobrien							 void *, void *));
5490075Sobrienint lhd_tree_inlining_cannot_inline_tree_fn	PARAMS ((tree *));
5590075Sobrienint lhd_tree_inlining_disregard_inline_limits	PARAMS ((tree));
5690075Sobrientree lhd_tree_inlining_add_pending_fn_decls	PARAMS ((void *, tree));
5790075Sobrienint lhd_tree_inlining_tree_chain_matters_p	PARAMS ((tree));
5890075Sobrienint lhd_tree_inlining_auto_var_in_fn_p		PARAMS ((tree, tree));
5990075Sobrientree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree,
6090075Sobrien							   tree, void *,
6190075Sobrien							   int *, void *));
6290075Sobrienint lhd_tree_inlining_anon_aggr_type_p		PARAMS ((tree));
6390075Sobrienint lhd_tree_inlining_start_inlining		PARAMS ((tree));
6490075Sobrienvoid lhd_tree_inlining_end_inlining		PARAMS ((tree));
6596263Sobrientree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
6690075Sobrien
6790075Sobrien#define LANG_HOOKS_NAME			"GNU unknown"
6890075Sobrien#define LANG_HOOKS_IDENTIFIER_SIZE	sizeof (struct lang_identifier)
6990075Sobrien#define LANG_HOOKS_INIT			lhd_do_nothing
7090075Sobrien#define LANG_HOOKS_FINISH		lhd_do_nothing
7190075Sobrien#define LANG_HOOKS_CLEAR_BINDING_STACK	lhd_clear_binding_stack
7290075Sobrien#define LANG_HOOKS_INIT_OPTIONS		lhd_do_nothing
7390075Sobrien#define LANG_HOOKS_DECODE_OPTION	lhd_decode_option
7490075Sobrien#define LANG_HOOKS_POST_OPTIONS		lhd_do_nothing
7590075Sobrien#define LANG_HOOKS_GET_ALIAS_SET	lhd_get_alias_set
7690075Sobrien#define LANG_HOOKS_EXPAND_CONSTANT	lhd_return_tree
7790075Sobrien#define LANG_HOOKS_SAFE_FROM_P		lhd_safe_from_p
7890075Sobrien#define LANG_HOOKS_STATICP		lhd_staticp
7990075Sobrien#define LANG_HOOKS_HONOR_READONLY	false
8090075Sobrien#define LANG_HOOKS_PRINT_STATISTICS	lhd_do_nothing
8190075Sobrien#define LANG_HOOKS_PRINT_XNODE		lhd_print_tree_nothing
8290075Sobrien#define LANG_HOOKS_PRINT_DECL		lhd_print_tree_nothing
8390075Sobrien#define LANG_HOOKS_PRINT_TYPE		lhd_print_tree_nothing
8490075Sobrien#define LANG_HOOKS_PRINT_IDENTIFIER	lhd_print_tree_nothing
8590075Sobrien#define LANG_HOOKS_SET_YYDEBUG		lhd_set_yydebug
8690075Sobrien
8790075Sobrien/* Tree inlining hooks.  */
8890075Sobrien#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees
8990075Sobrien#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
9090075Sobrien  lhd_tree_inlining_cannot_inline_tree_fn
9190075Sobrien#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
9290075Sobrien  lhd_tree_inlining_disregard_inline_limits
9390075Sobrien#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
9490075Sobrien  lhd_tree_inlining_add_pending_fn_decls
9590075Sobrien#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
9690075Sobrien  lhd_tree_inlining_tree_chain_matters_p
9790075Sobrien#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
9890075Sobrien  lhd_tree_inlining_auto_var_in_fn_p
9990075Sobrien#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
10090075Sobrien  lhd_tree_inlining_copy_res_decl_for_inlining
10190075Sobrien#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
10290075Sobrien  lhd_tree_inlining_anon_aggr_type_p
10390075Sobrien#define LANG_HOOKS_TREE_INLINING_START_INLINING \
10490075Sobrien  lhd_tree_inlining_start_inlining
10590075Sobrien#define LANG_HOOKS_TREE_INLINING_END_INLINING \
10690075Sobrien  lhd_tree_inlining_end_inlining
10796263Sobrien#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
10896263Sobrien  lhd_tree_inlining_convert_parm_for_inlining
10990075Sobrien
11090075Sobrien#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
11190075Sobrien  LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
11290075Sobrien  LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
11390075Sobrien  LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
11490075Sobrien  LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, \
11590075Sobrien  LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, \
11690075Sobrien  LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
11790075Sobrien  LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \
11890075Sobrien  LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \
11990075Sobrien  LANG_HOOKS_TREE_INLINING_START_INLINING, \
12096263Sobrien  LANG_HOOKS_TREE_INLINING_END_INLINING, \
12196263Sobrien  LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
12290075Sobrien} \
12390075Sobrien
12490075Sobrien/* Tree dump hooks.  */
12590075Sobrienint lhd_tree_dump_dump_tree 			PARAMS ((void *, tree));
12690075Sobrienint lhd_tree_dump_type_quals			PARAMS ((tree));
12790075Sobrien
12890075Sobrien#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
12990075Sobrien#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
13090075Sobrien
13190075Sobrien#define LANG_HOOKS_TREE_DUMP_INITIALIZER { \
13290075Sobrien  LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \
13390075Sobrien  LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
13490075Sobrien} \
13590075Sobrien
13690075Sobrien/* The whole thing.  The structure is defined in langhooks.h.  */
13790075Sobrien#define LANG_HOOKS_INITIALIZER { \
13890075Sobrien  LANG_HOOKS_NAME, \
13990075Sobrien  LANG_HOOKS_IDENTIFIER_SIZE, \
14090075Sobrien  LANG_HOOKS_INIT_OPTIONS, \
14190075Sobrien  LANG_HOOKS_DECODE_OPTION, \
14290075Sobrien  LANG_HOOKS_POST_OPTIONS, \
14390075Sobrien  LANG_HOOKS_INIT, \
14490075Sobrien  LANG_HOOKS_FINISH, \
14590075Sobrien  LANG_HOOKS_CLEAR_BINDING_STACK, \
14690075Sobrien  LANG_HOOKS_GET_ALIAS_SET, \
14790075Sobrien  LANG_HOOKS_EXPAND_CONSTANT, \
14890075Sobrien  LANG_HOOKS_SAFE_FROM_P, \
14990075Sobrien  LANG_HOOKS_STATICP, \
15090075Sobrien  LANG_HOOKS_HONOR_READONLY, \
15190075Sobrien  LANG_HOOKS_PRINT_STATISTICS, \
15290075Sobrien  LANG_HOOKS_PRINT_XNODE, \
15390075Sobrien  LANG_HOOKS_PRINT_DECL, \
15490075Sobrien  LANG_HOOKS_PRINT_TYPE, \
15590075Sobrien  LANG_HOOKS_PRINT_IDENTIFIER, \
15690075Sobrien  LANG_HOOKS_SET_YYDEBUG, \
15790075Sobrien  LANG_HOOKS_TREE_INLINING_INITIALIZER, \
15890075Sobrien  LANG_HOOKS_TREE_DUMP_INITIALIZER \
15990075Sobrien}
16090075Sobrien
16190075Sobrien#endif /* GCC_LANG_HOOKS_DEF_H */
162