diff options
author | Richard Henderson <rth@cygnus.com> | 1998-01-25 14:14:54 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1998-01-25 14:14:54 -0800 |
commit | 83c8ddef65d203fb5f88d54ba13a2ec19be950a2 (patch) | |
tree | f84fd5f4b3afd5918db538a0da9c56f13e945c24 /gcc/toplev.c | |
parent | db81d74a81ff11aac0c707b76bbbd6bd49289fbc (diff) | |
download | gcc-83c8ddef65d203fb5f88d54ba13a2ec19be950a2.zip gcc-83c8ddef65d203fb5f88d54ba13a2ec19be950a2.tar.gz gcc-83c8ddef65d203fb5f88d54ba13a2ec19be950a2.tar.bz2 |
* toplev.c (get_run_time): Make sure each case gets its variables.
From-SVN: r17484
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 2cb442f..fbdbc41 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -994,26 +994,9 @@ int dump_time; int get_run_time () { -#if !defined (_WIN32) || defined (__CYGWIN32__) -#ifdef USG - struct tms tms; -#else -#ifndef VMS - struct rusage rusage; -#else - struct - { - int proc_user_time; - int proc_system_time; - int child_user_time; - int child_system_time; - } vms_times; -#endif -#endif -#endif - if (quiet_flag) return 0; + #ifdef __BEOS__ return 0; #else /* not BeOS */ @@ -1026,6 +1009,7 @@ get_run_time () #ifdef _SC_CLK_TCK { static int tick; + struct tms tms; if (tick == 0) tick = 1000000 / sysconf(_SC_CLK_TCK); times (&tms); @@ -1033,16 +1017,31 @@ get_run_time () } #else #ifdef USG - times (&tms); - return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); + { + struct tms tms; + times (&tms); + return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); + } #else #ifndef VMS - getrusage (0, &rusage); - return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec - + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); + { + struct rusage rusage; + getrusage (0, &rusage); + return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec + + rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec); + } #else /* VMS */ - times ((void *) &vms_times); - return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000; + { + struct + { + int proc_user_time; + int proc_system_time; + int child_user_time; + int child_system_time; + } vms_times; + times ((void *) &vms_times); + return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000; + } #endif /* VMS */ #endif /* USG */ #endif /* _SC_CLK_TCK */ |