summaryrefslogtreecommitdiff
path: root/gcc/timevar.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-09 16:23:47 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-09 16:23:47 +0000
commita6260fc7cbd357861d5a9b52ece9180843c26ebe (patch)
tree0298128e12299bf28f76cc3ef5ad263e2fa59173 /gcc/timevar.c
parentec0a21033a8b56a7d188dd98e50264dc5f2393fd (diff)
downloadgcc-a6260fc7cbd357861d5a9b52ece9180843c26ebe.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34470 138bc75d-0d04-0410-961f-82ee72b054a4
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)
{