diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-10-08 20:54:07 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2001-10-08 20:54:07 +0000 |
commit | 69dcadffbabaf5fd3b0fa3f14b5de097c40a2751 (patch) | |
tree | f37df892d870d138dc0e3460f96264fd2648883e /gcc/c-lang.c | |
parent | 19551f2985c293a1041a0e7755627e87eb1559b7 (diff) | |
download | gcc-69dcadffbabaf5fd3b0fa3f14b5de097c40a2751.zip gcc-69dcadffbabaf5fd3b0fa3f14b5de097c40a2751.tar.gz gcc-69dcadffbabaf5fd3b0fa3f14b5de097c40a2751.tar.bz2 |
langhooks.h: New file.
* langhooks.h: New file.
* Makefile.in (OBJS): Added langhooks.o.
(c-lang.o): Depend on langhooks.h.
(c-common.o): Don't depend on tree-inline.h.
(tree-inline.o): Depend on toplev.h.
(langhooks.o): New rule.
* c-common.c: Don't include tree-inline.h.
(c_mark_lang_decl): Mark argument c as unused.
(c_common_lang_init): Don't initialize hooks here.
* c-lang.c: Include langhooks.h, then override some macros.
(lang_hooks): Initialize with macros in langhooks.h.
(c_init): Don't initialize hooks here.
* toplev.c (struct lang_hooks_for_tree_inlining): New struct.
(struct lang_hooks): Add tree_inlining. Refer to langhooks.h.
* tree-inline.c: Include toplev.h. Don't define hook variables.
* tree-inline.h: Don't define hook types nor declare hook
variables. Move macros to...
* langhooks.c: ... new file, as functions. Adjust all callers.
From-SVN: r46096
Diffstat (limited to 'gcc/c-lang.c')
-rw-r--r-- | gcc/c-lang.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 6ff8b9c..e1fd83e 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -38,6 +38,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "cpplib.h" #include "insn-config.h" #include "integrate.h" +#include "langhooks.h" static int c_tree_printer PARAMS ((output_buffer *)); static int c_missing_noreturn_ok_p PARAMS ((tree)); @@ -47,12 +48,26 @@ static void c_post_options PARAMS ((void)); static int c_disregard_inline_limits PARAMS ((tree)); static int c_cannot_inline_tree_fn PARAMS ((tree *)); +#undef LANG_HOOKS_INIT +#define LANG_HOOKS_INIT c_init +#undef LANG_HOOKS_INIT_OPTIONS +#define LANG_HOOKS_INIT_OPTIONS c_init_options +#undef LANG_HOOKS_DECODE_OPTION +#define LANG_HOOKS_DECODE_OPTION c_decode_option +#undef LANG_HOOKS_POST_OPTIONS +#define LANG_HOOKS_POST_OPTIONS c_post_options +#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN +#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ + c_cannot_inline_tree_fn +#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS +#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \ + c_disregard_inline_limits +#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P +#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \ + anon_aggr_type_p + /* Each front end provides its own. */ -struct lang_hooks lang_hooks = {c_init, - NULL, /* c_finish */ - c_init_options, - c_decode_option, - c_post_options}; +struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; /* Post-switch processing. */ static void @@ -112,8 +127,6 @@ c_init () diagnostic_format_decoder (global_dc) = &c_tree_printer; lang_expand_decl_stmt = &c_expand_decl_stmt; lang_missing_noreturn_ok_p = &c_missing_noreturn_ok_p; - lang_disregard_inline_limits = &c_disregard_inline_limits; - lang_cannot_inline_tree_fn = &c_cannot_inline_tree_fn; c_parse_init (); } |