aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2003-04-26 15:19:06 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-04-26 15:19:06 +0000
commit09b04f2d9f3a2fd97e9794dc7fc7857de4be971c (patch)
tree6424ff69f6fae47ba0b6239a1c29e1973c0dafc6 /gcc/toplev.c
parent3e35d143117380707aebb2c46f3ec7e200f46b04 (diff)
downloadgcc-09b04f2d9f3a2fd97e9794dc7fc7857de4be971c.zip
gcc-09b04f2d9f3a2fd97e9794dc7fc7857de4be971c.tar.gz
gcc-09b04f2d9f3a2fd97e9794dc7fc7857de4be971c.tar.bz2
flags.h (time_report): Remove.
* flags.h (time_report): Remove. * timevar.c (timevar_enable): New. (TIMEVAR_ENABLE): Remove, use timevar_enable. (timevar_init): Rename from init_timevar. * timevar.h (timevar_init): Rename from init_timevar. * toplev.c (time_report): Make static. (do_compile): Conditionally call init_timevar first. (preprocess_options): Move some code to do_compile. From-SVN: r66110
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index f0f25db..4d7e351 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -431,7 +431,7 @@ int quiet_flag = 0;
/* Print times taken by the various passes. -ftime-report. */
-int time_report = 0;
+static int time_report = 0;
/* Print memory still in use at end of compilation (which may have little
to do with peak memory consumption). -fmem-report. */
@@ -5326,9 +5326,6 @@ process_options ()
print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
}
- if (! quiet_flag || flag_detailed_statistics)
- time_report = 1;
-
if (flag_syntax_only)
{
write_symbols = NO_DEBUG;
@@ -5562,20 +5559,27 @@ finalize ()
static void
do_compile ()
{
- /* We cannot start timing until after options are processed since that
- says if we run timers or not. */
- init_timevar ();
+ /* Initialize timing first. The C front ends read the main file in
+ the post_options hook, and C++ does file timings. */
+ if (time_report || !quiet_flag || flag_detailed_statistics)
+ timevar_init ();
timevar_start (TV_TOTAL);
- /* Set up the back-end if requested. */
- if (!no_backend)
- backend_init ();
+ process_options ();
+
+ /* Don't do any more if an error has already occurred. */
+ if (!errorcount)
+ {
+ /* Set up the back-end if requested. */
+ if (!no_backend)
+ backend_init ();
- /* Language-dependent initialization. Returns true on success. */
- if (lang_dependent_init (filename))
- compile_file ();
+ /* Language-dependent initialization. Returns true on success. */
+ if (lang_dependent_init (filename))
+ compile_file ();
- finalize ();
+ finalize ();
+ }
/* Stop timing and print the times. */
timevar_stop (TV_TOTAL);
@@ -5603,13 +5607,7 @@ toplev_main (argc, argv)
/* Exit early if we can (e.g. -help). */
if (!exit_after_options)
- {
- process_options ();
-
- /* Don't do any more if an error has already occurred. */
- if (!errorcount)
- do_compile ();
- }
+ do_compile ();
if (errorcount || sorrycount)
return (FATAL_EXIT_CODE);