OSDN Git Service

* config/h8300/h8300.md (a peephole2): Remove useless code.
[pf3gnuchains/gcc-fork.git] / gcc / timevar.c
index 3697a5a..2eeeaa2 100644 (file)
@@ -21,17 +21,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 #include "config.h"
 #include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "intl.h"
-#include "rtl.h"
-
 #ifdef HAVE_SYS_TIMES_H
 # include <sys/times.h>
 #endif
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
+#include "coretypes.h"
+#include "tm.h"
+#include "intl.h"
+#include "rtl.h"
+#include "toplev.h"
 
 #ifndef HAVE_CLOCK_T
 typedef int clock_t;
@@ -47,16 +47,6 @@ struct tms
 };
 #endif
 
-#if defined HAVE_DECL_GETRUSAGE && !HAVE_DECL_GETRUSAGE
-extern int getrusage PARAMS ((int, struct rusage *));
-#endif
-#if defined HAVE_DECL_TIMES && !HAVE_DECL_TIMES
-extern clock_t times PARAMS ((struct tms *));
-#endif
-#if defined HAVE_DECL_CLOCK && !HAVE_DECL_CLOCK
-extern clock_t clock PARAMS ((void));
-#endif
-
 #ifndef RUSAGE_SELF
 # define RUSAGE_SELF 0
 #endif
@@ -80,17 +70,26 @@ extern clock_t clock PARAMS ((void));
 /* Prefer times to getrusage to clock (each gives successively less
    information).  */
 #ifdef HAVE_TIMES
+# if defined HAVE_DECL_TIMES && !HAVE_DECL_TIMES
+  extern clock_t times PARAMS ((struct tms *));
+# endif
 # define USE_TIMES
 # define HAVE_USER_TIME
 # define HAVE_SYS_TIME
 # define HAVE_WALL_TIME
 #else
 #ifdef HAVE_GETRUSAGE
+# if defined HAVE_DECL_GETRUSAGE && !HAVE_DECL_GETRUSAGE
+  extern int getrusage PARAMS ((int, struct rusage *));
+# endif
 # define USE_GETRUSAGE
 # define HAVE_USER_TIME
 # define HAVE_SYS_TIME
 #else
 #ifdef HAVE_CLOCK
+# if defined HAVE_DECL_CLOCK && !HAVE_DECL_CLOCK
+  extern clock_t clock PARAMS ((void));
+# endif
 # define USE_CLOCK
 # define HAVE_USER_TIME
 #endif
@@ -133,11 +132,11 @@ struct timevar_def
   /* The name of this timing variable.  */
   const char *name;
 
-  /* Non-zero if this timing variable is running as a standalone
+  /* Nonzero if this timing variable is running as a standalone
      timer.  */
   unsigned standalone : 1;
 
-  /* Non-zero if this timing variable was ever started or pushed onto
+  /* Nonzero if this timing variable was ever started or pushed onto
      the timing stack.  */
   unsigned used : 1;
 };
@@ -319,7 +318,11 @@ timevar_pop (timevar)
     return;
 
   if (&timevars[timevar] != stack->timevar)
-    abort ();
+    {
+      sorry ("cannot timevar_pop '%s' when top of timevars stack is '%s'",
+             timevars[timevar].name, stack->timevar->name);
+      abort ();
+    }
 
   /* What time is it?  */
   get_time (&now);