+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
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)
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)
#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;
#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;
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];
}
/* Print total time. */
- fputs (_(" TOTAL :"), fp);
+ fputs (" TOTAL :", fp);
#ifdef HAVE_USER_TIME
fprintf (fp, "%7.2f ", total->user);
#endif
{
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));
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);
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 */