From 69dcadffbabaf5fd3b0fa3f14b5de097c40a2751 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 8 Oct 2001 20:54:07 +0000 Subject: 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 --- gcc/toplev.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gcc/toplev.h') diff --git a/gcc/toplev.h b/gcc/toplev.h index 860d49b..72fa2fd 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -115,7 +115,31 @@ extern void check_global_declarations PARAMS ((union tree_node **, int)); extern const char *progname; extern const char *dump_base_name; +/* The following hooks are documented in langhooks.c. Must not be + NULL. */ + +struct lang_hooks_for_tree_inlining +{ + union tree_node *(*walk_subtrees) PARAMS ((union tree_node **, int *, + union tree_node *(*) + (union tree_node **, + int *, void *), + void *, void *)); + int (*cannot_inline_tree_fn) PARAMS ((union tree_node **)); + int (*disregard_inline_limits) PARAMS ((union tree_node *)); + union tree_node *(*add_pending_fn_decls) PARAMS ((void*, union tree_node *)); + int (*tree_chain_matters_p) PARAMS ((union tree_node *)); + int (*auto_var_in_fn_p) PARAMS ((union tree_node *, union tree_node *)); + union tree_node *(*copy_res_decl_for_inlining) PARAMS ((union tree_node *, + union tree_node *, + union tree_node *, + void *, int *, + void *)); + int (*anon_aggr_type_p) PARAMS ((union tree_node *)); +}; + /* Language-specific hooks. Can be NULL unless otherwise specified. */ + struct lang_hooks { /* Called first, to initialize the front end. */ @@ -141,6 +165,11 @@ struct lang_hooks /* Called when all command line options have been processed. */ void (*post_options) PARAMS ((void)); + + struct lang_hooks_for_tree_inlining tree_inlining; + + /* Whenever you add entries here, make sure you adjust langhooks.h + and langhooks.c accordingly. */ }; /* Each front end provides its own. */ -- cgit v1.1