diff options
author | Neil Booth <neil@gcc.gnu.org> | 2001-01-09 10:54:01 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-01-09 10:54:01 +0000 |
commit | 13c61421ff315b27bb41e6ac8ccacdebab9d8247 (patch) | |
tree | 5175214bd3273e1990f7d1c7e0d43f3853a1fc53 /gcc | |
parent | fb83deef1a1438c21b65535483a4726f31862b20 (diff) | |
download | gcc-13c61421ff315b27bb41e6ac8ccacdebab9d8247.zip gcc-13c61421ff315b27bb41e6ac8ccacdebab9d8247.tar.gz gcc-13c61421ff315b27bb41e6ac8ccacdebab9d8247.tar.bz2 |
c-lang.c (lang_hooks): Update.
* c-lang.c (lang_hooks): Update.
(lang_init): Rename c_init.
(lang_finish): Remove.
* toplev.c (compile_file): Use lang_hooks for lang_init ()
and lang_finish ().
* toplev.h (lang_hooks): Add init () and finish ().
* tree.h (lang_init, lang_finish): Remove.
* cp/tree.h (lang_init, lang_finish): Remove.
* cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c.
* cp/lex.c (cxx_init, cxx_finish, cxx_post_options,
lang_hooks): New.
(lang_init, lang_finish): Remove.
* f/com.c (lang_init, lang_finish): Rename f_init, f_finish.
(lang_hooks): Update.
* java/lang.c (lang_init): Rename java_init.
(lang_finish): Remove.
(lang_hooks): Update.
* objc/objc-act.c (lang_init): Rename objc_init.
(lang_finish): Remove.
(lang_hoooks): Update.
From-SVN: r38828
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-lang.c | 14 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 11 | ||||
-rw-r--r-- | gcc/cp/lex.c | 23 | ||||
-rw-r--r-- | gcc/f/com.c | 15 | ||||
-rw-r--r-- | gcc/java/lang.c | 14 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 14 | ||||
-rw-r--r-- | gcc/toplev.c | 6 | ||||
-rw-r--r-- | gcc/toplev.h | 10 | ||||
-rw-r--r-- | gcc/tree.h | 5 |
10 files changed, 58 insertions, 56 deletions
diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 5b08679..f8cefb3 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -38,10 +38,13 @@ Boston, MA 02111-1307, USA. */ static int c_tree_printer PARAMS ((output_buffer *)); static int c_missing_noreturn_ok_p PARAMS ((tree)); +static void c_init PARAMS ((void)); static void c_post_options PARAMS ((void)); /* Each front end provides its own. */ -struct lang_hooks lang_hooks = {c_post_options}; +struct lang_hooks lang_hooks = {c_init, + NULL, /* c_finish */ + c_post_options}; /* Post-switch processing. */ static void @@ -69,8 +72,8 @@ lang_init_options () flag_bounds_check = -1; } -void -lang_init () +static void +c_init () { c_common_lang_init (); @@ -95,11 +98,6 @@ lang_init () c_parse_init (); } -void -lang_finish () -{ -} - const char * lang_identify () { diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index e69a23a..e2309e9 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4062,8 +4062,6 @@ extern tree make_pointer_declarator PARAMS ((tree, tree)); extern tree make_reference_declarator PARAMS ((tree, tree)); extern tree make_call_declarator PARAMS ((tree, tree, tree, tree)); extern void set_quals_and_spec PARAMS ((tree, tree, tree)); -extern void lang_init PARAMS ((void)); -extern void lang_finish PARAMS ((void)); extern void print_parse_statistics PARAMS ((void)); extern void do_pending_inlines PARAMS ((void)); extern void process_next_inline PARAMS ((struct unparsed_text *)); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index e07a749..8bdd43e 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -59,7 +59,6 @@ typedef struct priority_info_s { int destructions_p; } *priority_info; -static void cxx_post_options PARAMS ((void)); static void mark_vtable_entries PARAMS ((tree)); static void grok_function_init PARAMS ((tree, tree)); static int finish_vtable_vardecl PARAMS ((tree *, void *)); @@ -544,16 +543,6 @@ static const char * const unsupported_options[] = { "strict-prototype", }; -/* Each front end provides its own. */ -struct lang_hooks lang_hooks = {cxx_post_options}; - -/* Post-switch processing. */ -static void -cxx_post_options () -{ - cpp_post_options (parse_in); -} - /* Compare two option strings, pointed two by P1 and P2, for use with bsearch. */ diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index a203ac9..3203b4c 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -61,6 +61,9 @@ static void handle_pragma_vtable PARAMS ((cpp_reader *)); static void handle_pragma_unit PARAMS ((cpp_reader *)); static void handle_pragma_interface PARAMS ((cpp_reader *)); static void handle_pragma_implementation PARAMS ((cpp_reader *)); +static void cxx_init PARAMS ((void)); +static void cxx_finish PARAMS ((void)); +static void cxx_post_options PARAMS ((void)); #ifdef GATHER_STATISTICS #ifdef REDUCE_LENGTH @@ -240,7 +243,17 @@ static const char *cplus_tree_code_name[] = { }; #undef DEFTREECODE -/* toplev.c needs to call these. */ +/* Each front end provides its own hooks, for toplev.c. */ +struct lang_hooks lang_hooks = {cxx_init, + cxx_finish, + cxx_post_options}; + +/* Post-switch processing. */ +static void +cxx_post_options () +{ + cpp_post_options (parse_in); +} void lang_init_options () @@ -259,8 +272,8 @@ lang_init_options () set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE); } -void -lang_init () +static void +cxx_init () { c_common_lang_init (); @@ -268,8 +281,8 @@ lang_init () init_repo (input_filename); } -void -lang_finish () +static void +cxx_finish () { if (flag_gnu_xref) GNU_xref_end (errorcount+sorrycount); } diff --git a/gcc/f/com.c b/gcc/f/com.c index f6f80e0..cdd48bf 100644 --- a/gcc/f/com.c +++ b/gcc/f/com.c @@ -14677,7 +14677,12 @@ insert_block (block) } /* Each front end provides its own. */ -struct lang_hooks lang_hooks = {NULL /* post_options */}; +static void f_init PARAMS ((void)); +static void f_finish PARAMS ((void)); + +struct lang_hooks lang_hooks = {f_init, + f_finish, + NULL /* post_options */}; int lang_decode_option (argc, argv) @@ -14697,8 +14702,8 @@ lang_print_xnode (file, node, indent) { } -void -lang_finish () +static void +f_finish () { ffe_terminate_0 (); @@ -14738,8 +14743,8 @@ lang_init_options () flag_complex_divide_method = 1; } -void -lang_init () +static void +f_init () { /* If the file is output from cpp, it should contain a first line `# 1 "real-filename"', and the current design of gcc (toplev.c diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 3a9f345..9b299b2 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -45,6 +45,7 @@ struct string_option int on_value; }; +static void java_init PARAMS ((void)); static void put_decl_string PARAMS ((const char *, int)); static void put_decl_node PARAMS ((tree)); static void java_dummy_print PARAMS ((const char *)); @@ -187,7 +188,9 @@ static int dependency_tracking = 0; #define DEPEND_FILE_ALREADY_SET 8 /* Each front end provides its own. */ -struct lang_hooks lang_hooks = {NULL /* post_options */}; +struct lang_hooks lang_hooks = {java_init, + NULL, /* java_finish */ + NULL /* post_options */}; /* Process an option that can accept a `no-' form. Return 1 if option found, 0 otherwise. */ @@ -615,8 +618,8 @@ lang_print_error (file) } -void -lang_init () +static void +java_init () { #if 0 extern int flag_minimal_debug; @@ -682,11 +685,6 @@ lang_init_options () flag_bounds_check = 1; } -void -lang_finish () -{ -} - const char * lang_identify () { diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index e2daab1..b70c3e6 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -149,6 +149,7 @@ char *util_firstobj; static void init_objc PARAMS ((void)); static void finish_objc PARAMS ((void)); static void objc_post_options PARAMS ((void)); +static void objc_init PARAMS ((void)); /* Code generation. */ @@ -628,7 +629,9 @@ static int generating_instance_variables = 0; static int print_struct_values = 0; /* Each front end provides its own. */ -struct lang_hooks lang_hooks = {objc_post_options}; +struct lang_hooks lang_hooks = {objc_init, + NULL, /* objc_finish */ + objc_post_options}; /* Post-switch processing. */ static void @@ -707,8 +710,8 @@ lang_init_options () c_language = clk_objective_c; } -void -lang_init () +static void +objc_init () { /* Force the line number back to 0; check_newline will have raised it to 1, which will make the builtin functions appear @@ -765,11 +768,6 @@ finish_file () fclose (gen_declaration_file); } -void -lang_finish () -{ -} - const char * lang_identify () { diff --git a/gcc/toplev.c b/gcc/toplev.c index 0d51302..32effd4 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2248,7 +2248,8 @@ compile_file (name) /* Perform language-specific initialization. This may set main_input_filename. */ - lang_init (); + if (lang_hooks.init) + (*lang_hooks.init) (); /* If the input doesn't start with a #line, use the input name as the official input file name. */ @@ -2480,7 +2481,8 @@ compile_file (name) /* Language-specific end of compilation actions. */ finish_syntax: - lang_finish (); + if (lang_hooks.finish) + (*lang_hooks.finish) (); /* Close the dump files. */ diff --git a/gcc/toplev.h b/gcc/toplev.h index 05fca01..f0c37f8 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -133,10 +133,16 @@ extern int sorrycount; extern const char *progname; -/* Language-specific hooks. */ +/* Language-specific hooks. Can be NULL unless otherwise specified. */ struct lang_hooks { - /* If non-NULL, called when all command line options have been processed. */ + /* Called first, to initialize the front end. */ + void (*init) PARAMS ((void)); + + /* Called last, as a finalizer. */ + void (*finish) PARAMS ((void)); + + /* Called when all command line options have been processed. */ void (*post_options) PARAMS ((void)); }; @@ -2571,11 +2571,6 @@ extern void init_lex PARAMS ((void)); /* Function of no arguments for initializing the symbol table. */ extern void init_decl_processing PARAMS ((void)); -/* Functions called with no arguments at the beginning and end or processing - the input source file. */ -extern void lang_init PARAMS ((void)); -extern void lang_finish PARAMS ((void)); - /* Function to identify which front-end produced the output file. */ extern const char *lang_identify PARAMS ((void)); |