OSDN Git Service

* Makefile.in: Fix c-pch.o and ggc-common.o dependencies on timevars.
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 May 2010 23:00:23 +0000 (23:00 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 May 2010 23:00:23 +0000 (23:00 +0000)
* timevar.c: Do not include any core headers.
(timevar_print): De-i18n-ize.
(print_time): Likewise.
* timevar.h (timevar_push, timevar_pop): Make inline functions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159687 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/timevar.c
gcc/timevar.h

index 2033f79..1d6d14b 100644 (file)
@@ -1,3 +1,12 @@
+2010-05-21  Steven Bosscher  <steven@gcc.gnu.org>
+
+       * Makefile.in: Fix c-pch.o and ggc-common.o dependencies on timevars.
+
+       * timevar.c: Do not include any core headers.
+       (timevar_print): De-i18n-ize.
+       (print_time): Likewise.
+       * timevar.h (timevar_push, timevar_pop): Make inline functions.
+
 2010-05-21  Joseph Myers  <joseph@codesourcery.com>
 
        * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
index 20ab771..f416366 100644 (file)
@@ -2092,7 +2092,7 @@ c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
 c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \
        $(C_COMMON_H) output.h $(TOPLEV_H) $(C_PRAGMA_H) $(GGC_H) debug.h \
        langhooks.h $(FLAGS_H) hosthooks.h version.h $(TARGET_H) opts.h \
-       timevar.h
+       $(TIMEVAR_H)
        $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
          -DHOST_MACHINE=\"$(host)\" -DTARGET_MACHINE=\"$(target)\" \
          $< $(OUTPUT_OPTION)
@@ -2186,7 +2186,7 @@ gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
 
 ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h         \
        $(GGC_H) $(HASHTAB_H) $(TOPLEV_H) $(PARAMS_H) hosthooks.h       \
-       $(HOSTHOOKS_DEF_H) vec.h $(PLUGIN_H) timevar.h
+       $(HOSTHOOKS_DEF_H) vec.h $(PLUGIN_H) $(TIMEVAR_H)
 
 ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
        $(FLAGS_H) $(TOPLEV_H) $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H) $(PLUGIN_H)
index 4ba2864..df671e4 100644 (file)
@@ -26,11 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #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"
+#include "timevar.h"
 
 #ifndef HAVE_CLOCK_T
 typedef int clock_t;
@@ -109,8 +105,8 @@ static double clocks_to_msec;
 #define CLOCKS_TO_MSEC (1 / (double)CLOCKS_PER_SEC)
 #endif
 
-#include "flags.h"
-#include "timevar.h"
+/* True if timevars should be used.  In GCC, this happens with
+   the -ftime-report flag.  */
 
 bool timevar_enable;
 
@@ -408,7 +404,7 @@ timevar_print (FILE *fp)
      TIMEVAR.  */
   start_time = now;
 
-  fputs (_("\nExecution times (seconds)\n"), fp);
+  fputs ("\nExecution times (seconds)\n", fp);
   for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
     {
       struct timevar_def *tv = &timevars[(timevar_id_t) id];
@@ -466,7 +462,7 @@ timevar_print (FILE *fp)
     }
 
   /* Print total time.  */
-  fputs (_(" TOTAL                 :"), fp);
+  fputs (" TOTAL                 :", fp);
 #ifdef HAVE_USER_TIME
   fprintf (fp, "%7.2f          ", total->user);
 #endif
@@ -499,7 +495,7 @@ print_time (const char *str, long total)
 {
   long all_time = get_run_time ();
   fprintf (stderr,
-          _("time in %s: %ld.%06ld (%ld%%)\n"),
+          "time in %s: %ld.%06ld (%ld%%)\n",
           str, total / 1000000, total % 1000000,
           all_time == 0 ? 0
           : (long) (((100.0 * (double) total) / (double) all_time) + .5));
index 8b4caba..e776dbf 100644 (file)
@@ -80,10 +80,15 @@ typedef enum
 timevar_id_t;
 #undef DEFTIMEVAR
 
+/* True if timevars should be used.  In GCC, this happens with
+   the -ftime-report flag.  */
+extern bool timevar_enable;
+
+/* Total amount of memory allocated by garbage collector.  */
+extern size_t timevar_ggc_mem_total;
+
 /* Execute the sequence: timevar_pop (TV), return (E);  */
 #define POP_TIMEVAR_AND_RETURN(TV, E)  do { timevar_pop (TV); return (E); }while(0)
-#define timevar_pop(TV) do { if (timevar_enable) timevar_pop_1 (TV); }while(0)
-#define timevar_push(TV) do { if (timevar_enable) timevar_push_1 (TV); }while(0)
 
 extern void timevar_init (void);
 extern void timevar_push_1 (timevar_id_t);
@@ -93,10 +98,20 @@ extern void timevar_stop (timevar_id_t);
 extern void timevar_print (FILE *);
 
 /* Provided for backward compatibility.  */
-extern void print_time (const char *, long);
+static inline void
+timevar_push (timevar_id_t tv)
+{
+  if (timevar_enable)
+    timevar_push_1 (tv);
+}
 
-extern bool timevar_enable;
+static inline void
+timevar_pop (timevar_id_t tv)
+{
+  if (timevar_enable)
+    timevar_pop_1 (tv);
+}
 
-extern size_t timevar_ggc_mem_total;
+extern void print_time (const char *, long);
 
 #endif /* ! GCC_TIMEVAR_H */