langhooks-def.h revision 102780
11573Srgrimes/* Default macros to initialize the lang_hooks data structure. 21573Srgrimes Copyright 2001 Free Software Foundation, Inc. 31573Srgrimes Contributed by Alexandre Oliva <aoliva@redhat.com> 41573Srgrimes 51573SrgrimesThis file is part of GNU CC. 61573Srgrimes 71573SrgrimesGNU CC is free software; you can redistribute it and/or modify 81573Srgrimesit under the terms of the GNU General Public License as published by 91573Srgrimesthe Free Software Foundation; either version 2, or (at your option) 101573Srgrimesany later version. 111573Srgrimes 121573SrgrimesGNU CC is distributed in the hope that it will be useful, 131573Srgrimesbut WITHOUT ANY WARRANTY; without even the implied warranty of 141573SrgrimesMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 151573SrgrimesGNU General Public License for more details. 161573Srgrimes 171573SrgrimesYou should have received a copy of the GNU General Public License 181573Srgrimesalong with GNU CC; see the file COPYING. If not, write to 191573Srgrimesthe Free Software Foundation, 59 Temple Place - Suite 330, 201573SrgrimesBoston, MA 02111-1307, USA. */ 211573Srgrimes 221573Srgrimes#ifndef GCC_LANG_HOOKS_DEF_H 231573Srgrimes#define GCC_LANG_HOOKS_DEF_H 241573Srgrimes 251573Srgrimes#include "hooks.h" 261573Srgrimes 271573Srgrimes/* Provide a hook routine for alias sets that always returns 1. This is 281573Srgrimes used by languages that haven't deal with alias sets yet. */ 291573Srgrimesextern HOST_WIDE_INT hook_get_alias_set_0 PARAMS ((tree)); 301573Srgrimes 311573Srgrimes/* Note to creators of new hooks: 321573Srgrimes 331573Srgrimes The macros in this file should NOT be surrounded by a 341573Srgrimes #ifdef...#endif pair, since this file declares the defaults. Each 351573Srgrimes front end overrides any hooks it wishes to, in the file containing 361573Srgrimes its struct lang_hooks, AFTER including this file. 371573Srgrimes 381573Srgrimes Prefix all default hooks with "lhd_". */ 391573Srgrimes 401573Srgrimes/* See langhooks.h for the definition and documentation of each hook. */ 411573Srgrimes 421573Srgrimesextern void lhd_do_nothing PARAMS ((void)); 431573Srgrimesextern int lhd_decode_option PARAMS ((int, char **)); 441573Srgrimesextern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree)); 451573Srgrimesextern tree lhd_return_tree PARAMS ((tree)); 4619059Swoschextern int lhd_safe_from_p PARAMS ((rtx, tree)); 471573Srgrimesextern int lhd_staticp PARAMS ((tree)); 481573Srgrimesextern void lhd_clear_binding_stack PARAMS ((void)); 4919059Swoschextern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int)); 501573Srgrimesextern void lhd_set_yydebug PARAMS ((int)); 5119276Sacheextern tree lhd_expr_size PARAMS ((tree)); 5219276Sache 531573Srgrimes/* Declarations of default tree inlining hooks. */ 541573Srgrimestree lhd_tree_inlining_walk_subtrees PARAMS ((tree *, int *, 5526484Sache walk_tree_fn, 5626484Sache void *, void *)); 5726484Sacheint lhd_tree_inlining_cannot_inline_tree_fn PARAMS ((tree *)); 581573Srgrimesint lhd_tree_inlining_disregard_inline_limits PARAMS ((tree)); 5926484Sachetree lhd_tree_inlining_add_pending_fn_decls PARAMS ((void *, tree)); 6026484Sacheint lhd_tree_inlining_tree_chain_matters_p PARAMS ((tree)); 611573Srgrimesint lhd_tree_inlining_auto_var_in_fn_p PARAMS ((tree, tree)); 621573Srgrimestree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree, 631573Srgrimes tree, void *, 641573Srgrimes int *, void *)); 651573Srgrimesint lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree)); 661573Srgrimesint lhd_tree_inlining_start_inlining PARAMS ((tree)); 6726484Sachevoid lhd_tree_inlining_end_inlining PARAMS ((tree)); 681573Srgrimestree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree)); 691573Srgrimes 701573Srgrimes#define LANG_HOOKS_NAME "GNU unknown" 711573Srgrimes#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier) 721573Srgrimes#define LANG_HOOKS_INIT lhd_do_nothing 7319132Sache#define LANG_HOOKS_FINISH lhd_do_nothing 7419132Sache#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_clear_binding_stack 751573Srgrimes#define LANG_HOOKS_INIT_OPTIONS lhd_do_nothing 761573Srgrimes#define LANG_HOOKS_DECODE_OPTION lhd_decode_option 771573Srgrimes#define LANG_HOOKS_POST_OPTIONS hook_void_void 781573Srgrimes#define LANG_HOOKS_GET_ALIAS_SET lhd_get_alias_set 791573Srgrimes#define LANG_HOOKS_EXPAND_CONSTANT lhd_return_tree 801573Srgrimes#define LANG_HOOKS_SAFE_FROM_P lhd_safe_from_p 811573Srgrimes#define LANG_HOOKS_STATICP lhd_staticp 821573Srgrimes#define LANG_HOOKS_HONOR_READONLY false 831573Srgrimes#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing 841573Srgrimes#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing 851573Srgrimes#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing 861573Srgrimes#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing 871573Srgrimes#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing 881573Srgrimes#define LANG_HOOKS_SET_YYDEBUG lhd_set_yydebug 891573Srgrimes#define LANG_HOOKS_EXPR_SIZE lhd_expr_size 901573Srgrimes 911573Srgrimes/* Tree inlining hooks. */ 921573Srgrimes#define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES lhd_tree_inlining_walk_subtrees 931573Srgrimes#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ 941573Srgrimes lhd_tree_inlining_cannot_inline_tree_fn 951573Srgrimes#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ 961573Srgrimes lhd_tree_inlining_disregard_inline_limits 971573Srgrimes#define LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS \ 981573Srgrimes lhd_tree_inlining_add_pending_fn_decls 991573Srgrimes#define LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P \ 1001573Srgrimes lhd_tree_inlining_tree_chain_matters_p 10125269Sjdp#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \ 10225269Sjdp lhd_tree_inlining_auto_var_in_fn_p 1031573Srgrimes#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \ 1041573Srgrimes lhd_tree_inlining_copy_res_decl_for_inlining 1051573Srgrimes#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \ 1061573Srgrimes lhd_tree_inlining_anon_aggr_type_p 1071573Srgrimes#define LANG_HOOKS_TREE_INLINING_START_INLINING \ 1081573Srgrimes lhd_tree_inlining_start_inlining 1091573Srgrimes#define LANG_HOOKS_TREE_INLINING_END_INLINING \ 1101573Srgrimes lhd_tree_inlining_end_inlining 1111573Srgrimes#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ 1121573Srgrimes lhd_tree_inlining_convert_parm_for_inlining 1131573Srgrimes 1141573Srgrimes#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \ 1151573Srgrimes LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, \ 1161573Srgrimes LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \ 1171573Srgrimes LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \ 1181573Srgrimes LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, \ 1191573Srgrimes LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P, \ 1201573Srgrimes LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, \ 1211573Srgrimes LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, \ 1221573Srgrimes LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, \ 1231573Srgrimes LANG_HOOKS_TREE_INLINING_START_INLINING, \ 12426486Sache LANG_HOOKS_TREE_INLINING_END_INLINING, \ 1251573Srgrimes LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \ 12626486Sache} \ 12726486Sache 12826486Sache/* Tree dump hooks. */ 12926486Sacheint lhd_tree_dump_dump_tree PARAMS ((void *, tree)); 13026486Sacheint lhd_tree_dump_type_quals PARAMS ((tree)); 13126484Sache 13226484Sache#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree 13326484Sache#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals 13426484Sache 13526484Sache#define LANG_HOOKS_TREE_DUMP_INITIALIZER { \ 13626484Sache LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, \ 13726484Sache LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \ 1381573Srgrimes} \ 13926484Sache 1401573Srgrimes/* The whole thing. The structure is defined in langhooks.h. */ 1411573Srgrimes#define LANG_HOOKS_INITIALIZER { \ 1421573Srgrimes LANG_HOOKS_NAME, \ 1431573Srgrimes LANG_HOOKS_IDENTIFIER_SIZE, \ 1441573Srgrimes LANG_HOOKS_INIT_OPTIONS, \ 1451573Srgrimes LANG_HOOKS_DECODE_OPTION, \ 1461573Srgrimes LANG_HOOKS_POST_OPTIONS, \ 1471573Srgrimes LANG_HOOKS_INIT, \ 1481573Srgrimes LANG_HOOKS_FINISH, \ 1491573Srgrimes LANG_HOOKS_CLEAR_BINDING_STACK, \ 1501573Srgrimes LANG_HOOKS_GET_ALIAS_SET, \ 15126484Sache LANG_HOOKS_EXPAND_CONSTANT, \ 15219059Swosch LANG_HOOKS_SAFE_FROM_P, \ 15319059Swosch LANG_HOOKS_STATICP, \ 15419132Sache LANG_HOOKS_HONOR_READONLY, \ 15519132Sache LANG_HOOKS_PRINT_STATISTICS, \ 15619132Sache LANG_HOOKS_PRINT_XNODE, \ 15719059Swosch LANG_HOOKS_PRINT_DECL, \ 15819059Swosch LANG_HOOKS_PRINT_TYPE, \ 1591573Srgrimes LANG_HOOKS_PRINT_IDENTIFIER, \ 16019059Swosch LANG_HOOKS_SET_YYDEBUG, \ 1611573Srgrimes LANG_HOOKS_EXPR_SIZE, \ 1621573Srgrimes LANG_HOOKS_TREE_INLINING_INITIALIZER, \ 1631573Srgrimes LANG_HOOKS_TREE_DUMP_INITIALIZER \ 1641573Srgrimes} 1651573Srgrimes 16626484Sache#endif /* GCC_LANG_HOOKS_DEF_H */ 16726484Sache