diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2002-07-07 22:10:18 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-07-07 22:10:18 +0000 |
commit | 5351f1ca744b9d3e5285ff813839df3e43fe40b4 (patch) | |
tree | 3e569be0339cedb2fa3b07094857f01594bed4f5 /gcc/toplev.c | |
parent | c8cc4417e4b05d1ca1ef51a9bf38c1af29c29c55 (diff) | |
download | gcc-5351f1ca744b9d3e5285ff813839df3e43fe40b4.zip gcc-5351f1ca744b9d3e5285ff813839df3e43fe40b4.tar.gz gcc-5351f1ca744b9d3e5285ff813839df3e43fe40b4.tar.bz2 |
c-common.c (c_common_post_options): Update prototype; don't init backends if preprocessing only.
* c-common.c (c_common_post_options): Update prototype;
don't init backends if preprocessing only.
* langhooks-def.h (LANG_HOOKS_POST_OPTIONS): Update.
* langhooks.h (struct lang_hooks): Update post_options to
return a boolean.
* toplev.c (parse_options_and_default_flags, do_compile,
lang_independent_init): Update prototypes. Allow the
front end to specify that there is no need to initialize
the back end.
(general_init): Move call to hex_init here...
(toplev_main): ...from here. Pass flag for back end init
suppression.
java:
* lang.c (java_post_options): Update prototype.
From-SVN: r55306
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 0c2fd7c..d1af33e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -96,10 +96,10 @@ extern int size_directive_output; extern tree last_assemble_variable_decl; static void general_init PARAMS ((char *)); -static void parse_options_and_default_flags PARAMS ((int, char **)); -static void do_compile PARAMS ((void)); +static bool parse_options_and_default_flags PARAMS ((int, char **)); +static void do_compile PARAMS ((int)); static void process_options PARAMS ((void)); -static void lang_independent_init PARAMS ((void)); +static void lang_independent_init PARAMS ((int)); static int lang_dependent_init PARAMS ((const char *)); static void init_asm_output PARAMS ((const char *)); static void finalize PARAMS ((void)); @@ -4584,6 +4584,8 @@ general_init (argv0) xmalloc_set_program_name (progname); + hex_init (); + gcc_init_libintl (); /* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */ @@ -4614,8 +4616,10 @@ general_init (argv0) /* Parse command line options and set default flag values, called after language-independent option-independent initialization. Do minimal options processing. Outputting diagnostics is OK, but GC - and identifier hashtables etc. are not initialized yet. */ -static void + and identifier hashtables etc. are not initialized yet. + + Return non-zero to suppress compiler back end initialization. */ +static bool parse_options_and_default_flags (argc, argv) int argc; char **argv; @@ -4846,7 +4850,7 @@ parse_options_and_default_flags (argc, argv) /* All command line options have been parsed; allow the front end to perform consistency checks, etc. */ - (*lang_hooks.post_options) (); + return (*lang_hooks.post_options) (); } /* Process the options that have been parsed. */ @@ -5025,7 +5029,8 @@ process_options () /* Language-independent initialization, before language-dependent initialization. */ static void -lang_independent_init () +lang_independent_init (no_backend) + int no_backend; { /* Initialize the garbage-collector, and string pools. */ init_ggc (); @@ -5033,6 +5038,9 @@ lang_independent_init () init_stringpool (); init_obstacks (); + if (no_backend) + return; + /* init_emit_once uses reg_raw_mode and therefore must be called after init_regs which initialized reg_raw_mode. */ init_regs (); @@ -5167,7 +5175,8 @@ finalize () /* Initialize the compiler, and compile the input file. */ static void -do_compile () +do_compile (no_backend) + int no_backend; { /* The bulk of command line switch processing. */ process_options (); @@ -5178,8 +5187,8 @@ do_compile () timevar_start (TV_TOTAL); /* Language-independent initialization. Also sets up GC, identifier - hashes etc. */ - lang_independent_init (); + hashes etc., and the back-end if requested. */ + lang_independent_init (no_backend); /* Language-dependent initialization. Returns true on success. */ if (lang_dependent_init (filename)) @@ -5204,18 +5213,18 @@ toplev_main (argc, argv) int argc; char **argv; { - hex_init (); + bool no_backend; /* Initialization of GCC's environment, and diagnostics. */ general_init (argv[0]); /* Parse the options and do minimal processing; basically just enough to default flags appropriately. */ - parse_options_and_default_flags (argc, argv); + no_backend = parse_options_and_default_flags (argc, argv); /* Exit early if we can (e.g. -help). */ if (!errorcount && !exit_after_options) - do_compile (); + do_compile (no_backend); if (errorcount || sorrycount) return (FATAL_EXIT_CODE); |