langhooks-def.h revision 102780
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
25102780Skan#include "hooks.h"
26102780Skan
2790075Sobrien/* Provide a hook routine for alias sets that always returns 1.  This is
2890075Sobrien   used by languages that haven't deal with alias sets yet.  */
2990075Sobrienextern HOST_WIDE_INT hook_get_alias_set_0	PARAMS ((tree));
3090075Sobrien
3190075Sobrien/* Note to creators of new hooks:
3290075Sobrien
3390075Sobrien   The macros in this file should NOT be surrounded by a
3490075Sobrien   #ifdef...#endif pair, since this file declares the defaults.  Each
3590075Sobrien   front end overrides any hooks it wishes to, in the file containing
3690075Sobrien   its struct lang_hooks, AFTER including this file.
3790075Sobrien
3890075Sobrien   Prefix all default hooks with "lhd_".  */
3990075Sobrien
4090075Sobrien/* See langhooks.h for the definition and documentation of each hook.  */
4190075Sobrien
4290075Sobrienextern void lhd_do_nothing PARAMS ((void));
4390075Sobrienextern int lhd_decode_option PARAMS ((int, char **));
4490075Sobrienextern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
4590075Sobrienextern tree lhd_return_tree PARAMS ((tree));
4690075Sobrienextern int lhd_safe_from_p PARAMS ((rtx, tree));
4790075Sobrienextern int lhd_staticp PARAMS ((tree));
4890075Sobrienextern void lhd_clear_binding_stack PARAMS ((void));
4990075Sobrienextern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));
5090075Sobrienextern void lhd_set_yydebug PARAMS ((int));
51102780Skanextern tree lhd_expr_size PARAMS ((tree));
5290075Sobrien
5390075Sobrien/* Declarations of default tree inlining hooks.  */
5490075Sobrientree lhd_tree_inlining_walk_subtrees		PARAMS ((tree *, int *,
5590075Sobrien							 walk_tree_fn,
5690075Sobrien							 void *, void *));
5790075Sobrienint lhd_tree_inlining_cannot_inline_tree_fn	PARAMS ((tree *));
5890075Sobrienint lhd_tree_inlining_disregard_inline_limits	PARAMS ((tree));
5990075Sobrientree lhd_tree_inlining_add_pending_fn_decls	PARAMS ((void *, tree));
6090075Sobrienint lhd_tree_inlining_tree_chain_matters_p	PARAMS ((tree));
6190075Sobrienint lhd_tree_inlining_auto_var_in_fn_p		PARAMS ((tree, tree));
6290075Sobrientree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree,
6390075Sobrien							   tree, void *,
6490075Sobrien							   int *, void *));
6590075Sobrienint lhd_tree_inlining_anon_aggr_type_p		PARAMS ((tree));
6690075Sobrienint lhd_tree_inlining_start_inlining		PARAMS ((tree));
6790075Sobrienvoid lhd_tree_inlining_end_inlining		PARAMS ((tree));
6896263Sobrientree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
6990075Sobrien
7090075Sobrien#define LANG_HOOKS_NAME			"GNU unknown"
7190075Sobrien#define LANG_HOOKS_IDENTIFIER_SIZE	sizeof (struct lang_identifier)
7290075Sobrien#define LANG_HOOKS_INIT			lhd_do_nothing
7390075Sobrien#define LANG_HOOKS_FINISH		lhd_do_nothing
7490075Sobrien#define LANG_HOOKS_CLEAR_BINDING_STACK	lhd_clear_binding_stack
7590075Sobrien#define LANG_HOOKS_INIT_OPTIONS		lhd_do_nothing
7690075Sobrien#define LANG_HOOKS_DECODE_OPTION	lhd_decode_option
77102780Skan#define LANG_HOOKS_POST_OPTIONS		hook_void_void
7890075Sobrien#define LANG_HOOKS_GET_ALIAS_SET	lhd_get_alias_set
7990075Sobrien#define LANG_HOOKS_EXPAND_CONSTANT	lhd_return_tree
8090075Sobrien#define LANG_HOOKS_SAFE_FROM_P		lhd_safe_from_p
8190075Sobrien#define LANG_HOOKS_STATICP		lhd_staticp
8290075Sobrien#define LANG_HOOKS_HONOR_READONLY	false
8390075Sobrien#define LANG_HOOKS_PRINT_STATISTICS	lhd_do_nothing
8490075Sobrien#define LANG_HOOKS_PRINT_XNODE		lhd_print_tree_nothing
8590075Sobrien#define LANG_HOOKS_PRINT_DECL		lhd_print_tree_nothing
8690075Sobrien#define LANG_HOOKS_PRINT_TYPE		lhd_print_tree_nothing
8790075Sobrien#define LANG_HOOKS_PRINT_IDENTIFIER	lhd_print_tree_nothing
8890075Sobrien#define LANG_HOOKS_SET_YYDEBUG		lhd_set_yydebug
89102780Skan#define LANG_HOOKS_EXPR_SIZE		lhd_expr_size
9090075Sobrien
9190075Sobrien/* Tree inlining hooks.  */
9290075Sobrien#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees
9390075Sobrien#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
9490075Sobrien  lhd_tree_inlining_cannot_inline_tree_fn
9590075Sobrien#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
9690075Sobrien  lhd_tree_inlining_disregard_inline_limits
9790075Sobrien#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \
9890075Sobrien  lhd_tree_inlining_add_pending_fn_decls
9990075Sobrien#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \
10090075Sobrien  lhd_tree_inlining_tree_chain_matters_p
10190075Sobrien#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
10290075Sobrien  lhd_tree_inlining_auto_var_in_fn_p
10390075Sobrien#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
10490075Sobrien  lhd_tree_inlining_copy_res_decl_for_inlining
10590075Sobrien#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
10690075Sobrien  lhd_tree_inlining_anon_aggr_type_p
10790075Sobrien#define LANG_HOOKS_TREE_INLINING_START_INLINING \
10890075Sobrien  lhd_tree_inlining_start_inlining
10990075Sobrien#define LANG_HOOKS_TREE_INLINING_END_INLINING \
11090075Sobrien  lhd_tree_inlining_end_inlining
11196263Sobrien#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
11296263Sobrien  lhd_tree_inlining_convert_parm_for_inlining
11390075Sobrien
11490075Sobrien#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
11590075Sobrien  LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \
11690075Sobrien  LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
11790075Sobrien  LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
11890075Sobrien  LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, \
11990075Sobrien  LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, \
12090075Sobrien  LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \
12190075Sobrien  LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \
12290075Sobrien  LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \
12390075Sobrien  LANG_HOOKS_TREE_INLINING_START_INLINING, \
12496263Sobrien  LANG_HOOKS_TREE_INLINING_END_INLINING, \
12596263Sobrien  LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
12690075Sobrien} \
12790075Sobrien
12890075Sobrien/* Tree dump hooks.  */
12990075Sobrienint lhd_tree_dump_dump_tree 			PARAMS ((void *, tree));
13090075Sobrienint lhd_tree_dump_type_quals			PARAMS ((tree));
13190075Sobrien
13290075Sobrien#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
13390075Sobrien#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
13490075Sobrien
13590075Sobrien#define LANG_HOOKS_TREE_DUMP_INITIALIZER { \
13690075Sobrien  LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \
13790075Sobrien  LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
13890075Sobrien} \
13990075Sobrien
14090075Sobrien/* The whole thing.  The structure is defined in langhooks.h.  */
14190075Sobrien#define LANG_HOOKS_INITIALIZER { \
14290075Sobrien  LANG_HOOKS_NAME, \
14390075Sobrien  LANG_HOOKS_IDENTIFIER_SIZE, \
14490075Sobrien  LANG_HOOKS_INIT_OPTIONS, \
14590075Sobrien  LANG_HOOKS_DECODE_OPTION, \
14690075Sobrien  LANG_HOOKS_POST_OPTIONS, \
14790075Sobrien  LANG_HOOKS_INIT, \
14890075Sobrien  LANG_HOOKS_FINISH, \
14990075Sobrien  LANG_HOOKS_CLEAR_BINDING_STACK, \
15090075Sobrien  LANG_HOOKS_GET_ALIAS_SET, \
15190075Sobrien  LANG_HOOKS_EXPAND_CONSTANT, \
15290075Sobrien  LANG_HOOKS_SAFE_FROM_P, \
15390075Sobrien  LANG_HOOKS_STATICP, \
15490075Sobrien  LANG_HOOKS_HONOR_READONLY, \
15590075Sobrien  LANG_HOOKS_PRINT_STATISTICS, \
15690075Sobrien  LANG_HOOKS_PRINT_XNODE, \
15790075Sobrien  LANG_HOOKS_PRINT_DECL, \
15890075Sobrien  LANG_HOOKS_PRINT_TYPE, \
15990075Sobrien  LANG_HOOKS_PRINT_IDENTIFIER, \
16090075Sobrien  LANG_HOOKS_SET_YYDEBUG, \
161102780Skan  LANG_HOOKS_EXPR_SIZE, \
16290075Sobrien  LANG_HOOKS_TREE_INLINING_INITIALIZER, \
16390075Sobrien  LANG_HOOKS_TREE_DUMP_INITIALIZER \
16490075Sobrien}
16590075Sobrien
16690075Sobrien#endif /* GCC_LANG_HOOKS_DEF_H */
167