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
This commit is contained in:
Neil Booth 2001-01-09 10:54:01 +00:00
parent fb83deef1a
commit 13c61421ff
10 changed files with 58 additions and 56 deletions

View File

@ -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 ()
{

View File

@ -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 *));

View File

@ -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. */

View File

@ -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);
}

View File

@ -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

View File

@ -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 ()
{

View File

@ -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 ()
{

View File

@ -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. */

View File

@ -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));
};

View File

@ -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));