summaryrefslogtreecommitdiff
path: root/gcc/timevar.c
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.soma.redhat.com>2000-06-09 16:23:47 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-06-09 12:23:47 -0400
commitea11ca7ec12df7f53d437a738f984e26ef7ab85b (patch)
tree0298128e12299bf28f76cc3ef5ad263e2fa59173 /gcc/timevar.c
parent6efa15825eea54fa389d7b385f4f87e689ab61bc (diff)
downloadgcc-ea11ca7ec12df7f53d437a738f984e26ef7ab85b.tar.gz
timevar.def: Add TV_EXPAND.
* timevar.def: Add TV_EXPAND. * timevar.c (timevar_print): Update timing information. * calls.c (try_to_integrate): Push to TV_INTEGRATION for inlining. * stmt.c (expand_return): Check for error_mark_node. cp/: * semantics.c (expand_body): Push to TV_EXPAND. * optimize.c (optimize_function): Push to TV_INTEGRATION. * decl.c (start_function): Always call announce_function. * tinfo2.cc: Just declare abort. From-SVN: r34470
Diffstat (limited to 'gcc/timevar.c')
-rw-r--r--gcc/timevar.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/timevar.c b/gcc/timevar.c
index 756365bad5a..44ea96f35ab 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -405,10 +405,28 @@ timevar_print (fp)
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
timevar_id_t id;
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
+ struct timevar_time_def now;
if (!TIMEVAR_ENABLE)
return;
+ /* Update timing information in case we're calling this from GDB. */
+
+ if (fp == 0)
+ fp = stderr;
+
+ /* What time is it? */
+ get_time (&now);
+
+ /* If the stack isn't empty, attribute the current elapsed time to
+ the old topmost element. */
+ if (stack)
+ timevar_accumulate (&stack->timevar->elapsed, &start_time, &now);
+
+ /* Reset the start time; from now on, time is attributed to
+ TIMEVAR. */
+ start_time = now;
+
fprintf (fp, "\nExecution times (seconds)\n");
for (id = 0; id < TIMEVAR_LAST; ++id)
{