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
This commit is contained in:
parent
3e35d14311
commit
09b04f2d9f
@ -1,3 +1,14 @@
|
|||||||
|
2003-04-26 Neil Booth <neil@daikokuya.co.uk>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
|
2003-04-26 Stephane Carrez <stcarrez@nerim.fr>
|
||||||
|
|
||||||
* doc/install.texi (Binaries): Mention binaries for HC11/HC12.
|
* doc/install.texi (Binaries): Mention binaries for HC11/HC12.
|
||||||
|
@ -72,10 +72,6 @@ extern int optimize_size;
|
|||||||
|
|
||||||
extern int quiet_flag;
|
extern int quiet_flag;
|
||||||
|
|
||||||
/* Print times taken by the various passes. -ftime-report. */
|
|
||||||
|
|
||||||
extern int time_report;
|
|
||||||
|
|
||||||
/* Print memory still in use at end of compilation (which may have little
|
/* Print memory still in use at end of compilation (which may have little
|
||||||
to do with peak memory consumption). -fmem-report. */
|
to do with peak memory consumption). -fmem-report. */
|
||||||
|
|
||||||
|
@ -113,10 +113,9 @@ static double clocks_to_msec;
|
|||||||
#include "flags.h"
|
#include "flags.h"
|
||||||
#include "timevar.h"
|
#include "timevar.h"
|
||||||
|
|
||||||
/* See timevar.h for an explanation of timing variables. */
|
static bool timevar_enable;
|
||||||
|
|
||||||
/* This macro evaluates to nonzero if timing variables are enabled. */
|
/* See timevar.h for an explanation of timing variables. */
|
||||||
#define TIMEVAR_ENABLE (time_report)
|
|
||||||
|
|
||||||
/* A timing variable. */
|
/* A timing variable. */
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ get_time (now)
|
|||||||
now->sys = 0;
|
now->sys = 0;
|
||||||
now->wall = 0;
|
now->wall = 0;
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -225,10 +224,9 @@ timevar_accumulate (timer, start_time, stop_time)
|
|||||||
/* Initialize timing variables. */
|
/* Initialize timing variables. */
|
||||||
|
|
||||||
void
|
void
|
||||||
init_timevar ()
|
timevar_init ()
|
||||||
{
|
{
|
||||||
if (!TIMEVAR_ENABLE)
|
timevar_enable = true;
|
||||||
return;
|
|
||||||
|
|
||||||
/* Zero all elapsed times. */
|
/* Zero all elapsed times. */
|
||||||
memset ((void *) timevars, 0, sizeof (timevars));
|
memset ((void *) timevars, 0, sizeof (timevars));
|
||||||
@ -262,7 +260,7 @@ timevar_push (timevar)
|
|||||||
struct timevar_stack_def *context;
|
struct timevar_stack_def *context;
|
||||||
struct timevar_time_def now;
|
struct timevar_time_def now;
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Mark this timing variable as used. */
|
/* Mark this timing variable as used. */
|
||||||
@ -314,7 +312,7 @@ timevar_pop (timevar)
|
|||||||
struct timevar_time_def now;
|
struct timevar_time_def now;
|
||||||
struct timevar_stack_def *popped = stack;
|
struct timevar_stack_def *popped = stack;
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (&timevars[timevar] != stack->timevar)
|
if (&timevars[timevar] != stack->timevar)
|
||||||
@ -353,7 +351,7 @@ timevar_start (timevar)
|
|||||||
{
|
{
|
||||||
struct timevar_def *tv = &timevars[timevar];
|
struct timevar_def *tv = &timevars[timevar];
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Mark this timing variable as used. */
|
/* Mark this timing variable as used. */
|
||||||
@ -378,7 +376,7 @@ timevar_stop (timevar)
|
|||||||
struct timevar_def *tv = &timevars[timevar];
|
struct timevar_def *tv = &timevars[timevar];
|
||||||
struct timevar_time_def now;
|
struct timevar_time_def now;
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* TIMEVAR must have been started via timevar_start. */
|
/* TIMEVAR must have been started via timevar_start. */
|
||||||
@ -430,7 +428,7 @@ timevar_print (fp)
|
|||||||
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
|
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
|
||||||
struct timevar_time_def now;
|
struct timevar_time_def now;
|
||||||
|
|
||||||
if (!TIMEVAR_ENABLE)
|
if (!timevar_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Update timing information in case we're calling this from GDB. */
|
/* Update timing information in case we're calling this from GDB. */
|
||||||
|
@ -79,7 +79,7 @@ timevar_id_t;
|
|||||||
/* Execute the sequence: timevar_pop (TV), return (E); */
|
/* Execute the sequence: timevar_pop (TV), return (E); */
|
||||||
#define POP_TIMEVAR_AND_RETURN(TV, E) return (timevar_pop (TV), (E))
|
#define POP_TIMEVAR_AND_RETURN(TV, E) return (timevar_pop (TV), (E))
|
||||||
|
|
||||||
extern void init_timevar PARAMS ((void));
|
extern void timevar_init PARAMS ((void));
|
||||||
extern void timevar_push PARAMS ((timevar_id_t));
|
extern void timevar_push PARAMS ((timevar_id_t));
|
||||||
extern void timevar_pop PARAMS ((timevar_id_t));
|
extern void timevar_pop PARAMS ((timevar_id_t));
|
||||||
extern void timevar_start PARAMS ((timevar_id_t));
|
extern void timevar_start PARAMS ((timevar_id_t));
|
||||||
|
40
gcc/toplev.c
40
gcc/toplev.c
@ -431,7 +431,7 @@ int quiet_flag = 0;
|
|||||||
|
|
||||||
/* Print times taken by the various passes. -ftime-report. */
|
/* 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
|
/* Print memory still in use at end of compilation (which may have little
|
||||||
to do with peak memory consumption). -fmem-report. */
|
to do with peak memory consumption). -fmem-report. */
|
||||||
@ -5326,9 +5326,6 @@ process_options ()
|
|||||||
print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
|
print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! quiet_flag || flag_detailed_statistics)
|
|
||||||
time_report = 1;
|
|
||||||
|
|
||||||
if (flag_syntax_only)
|
if (flag_syntax_only)
|
||||||
{
|
{
|
||||||
write_symbols = NO_DEBUG;
|
write_symbols = NO_DEBUG;
|
||||||
@ -5562,20 +5559,27 @@ finalize ()
|
|||||||
static void
|
static void
|
||||||
do_compile ()
|
do_compile ()
|
||||||
{
|
{
|
||||||
/* We cannot start timing until after options are processed since that
|
/* Initialize timing first. The C front ends read the main file in
|
||||||
says if we run timers or not. */
|
the post_options hook, and C++ does file timings. */
|
||||||
init_timevar ();
|
if (time_report || !quiet_flag || flag_detailed_statistics)
|
||||||
|
timevar_init ();
|
||||||
timevar_start (TV_TOTAL);
|
timevar_start (TV_TOTAL);
|
||||||
|
|
||||||
/* Set up the back-end if requested. */
|
process_options ();
|
||||||
if (!no_backend)
|
|
||||||
backend_init ();
|
|
||||||
|
|
||||||
/* Language-dependent initialization. Returns true on success. */
|
/* Don't do any more if an error has already occurred. */
|
||||||
if (lang_dependent_init (filename))
|
if (!errorcount)
|
||||||
compile_file ();
|
{
|
||||||
|
/* Set up the back-end if requested. */
|
||||||
|
if (!no_backend)
|
||||||
|
backend_init ();
|
||||||
|
|
||||||
finalize ();
|
/* Language-dependent initialization. Returns true on success. */
|
||||||
|
if (lang_dependent_init (filename))
|
||||||
|
compile_file ();
|
||||||
|
|
||||||
|
finalize ();
|
||||||
|
}
|
||||||
|
|
||||||
/* Stop timing and print the times. */
|
/* Stop timing and print the times. */
|
||||||
timevar_stop (TV_TOTAL);
|
timevar_stop (TV_TOTAL);
|
||||||
@ -5603,13 +5607,7 @@ toplev_main (argc, argv)
|
|||||||
|
|
||||||
/* Exit early if we can (e.g. -help). */
|
/* Exit early if we can (e.g. -help). */
|
||||||
if (!exit_after_options)
|
if (!exit_after_options)
|
||||||
{
|
do_compile ();
|
||||||
process_options ();
|
|
||||||
|
|
||||||
/* Don't do any more if an error has already occurred. */
|
|
||||||
if (!errorcount)
|
|
||||||
do_compile ();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errorcount || sorrycount)
|
if (errorcount || sorrycount)
|
||||||
return (FATAL_EXIT_CODE);
|
return (FATAL_EXIT_CODE);
|
||||||
|
Loading…
Reference in New Issue
Block a user