X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftimevar.c;h=cce106abd71283ecb0e1b04146d555c6988ef011;hb=b956b40bae47f39073c0482db3dd1a041277b237;hp=6635c1d13dc0266651c733fcf4936a4be7c2aeaf;hpb=00edab463d3e9040c422c10beec27f1c2e266bf1;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/timevar.c b/gcc/timevar.c index 6635c1d13dc..cce106abd71 100644 --- a/gcc/timevar.c +++ b/gcc/timevar.c @@ -40,7 +40,7 @@ extern int getrusage PARAMS ((int, struct rusage *)); /* See timevar.h for an explanation of timing variables. */ /* This macro evaluates to non-zero if timing variables are enabled. */ -#define TIMEVAR_ENABLE (!quiet_flag) +#define TIMEVAR_ENABLE (time_report) /* A timing variable. */ @@ -95,8 +95,6 @@ static struct timevar_time_def start_time; static void get_time PARAMS ((struct timevar_time_def *)); -static void timevar_add - PARAMS ((struct timevar_time_def *, struct timevar_time_def *)); static void timevar_accumulate PARAMS ((struct timevar_time_def *, struct timevar_time_def *, struct timevar_time_def *)); @@ -197,18 +195,6 @@ get_time (now) #endif /* __BEOS__ */ } -/* Add ELAPSED to TIMER. */ - -static void -timevar_add (timer, elapsed) - struct timevar_time_def *timer; - struct timevar_time_def *elapsed; -{ - timer->user += elapsed->user; - timer->sys += elapsed->sys; - timer->wall += elapsed->wall; -} - /* Add the difference between STOP_TIME and START_TIME to TIMER. */ static void @@ -387,18 +373,22 @@ timevar_get (timevar, elapsed) struct timevar_time_def *elapsed; { struct timevar_def *tv = &timevars[timevar]; + struct timevar_time_def now; *elapsed = tv->elapsed; - + /* Is TIMEVAR currently running as a standalone timer? */ if (tv->standalone) - /* Add the time elapsed since the it was started. */ - timevar_add (elapsed, &tv->start_time); - - /* Is TIMEVAR at the top of the timer stack? */ - if (stack->timevar == tv) - /* Add the elapsed time since it was pushed. */ - timevar_add (elapsed, &start_time); + { + get_time (&now); + timevar_accumulate (elapsed, &tv->start_time, &now); + } + /* Or is TIMEVAR at the top of the timer stack? */ + else if (stack->timevar == tv) + { + get_time (&now); + timevar_accumulate (elapsed, &start_time, &now); + } } /* Summarize timing variables to FP. The timing variable TV_TOTAL has