Makefile.in: Fix c-pch.o and ggc-common.o dependencies on timevars.

* 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.

From-SVN: r159687
This commit is contained in:
Steven Bosscher 2010-05-21 23:00:23 +00:00
parent 5d127eeb29
commit 613b1547cb
4 changed files with 38 additions and 18 deletions

View 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

View 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)

View 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));

View 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. */
static inline void
timevar_push (timevar_id_t tv)
{
if (timevar_enable)
timevar_push_1 (tv);
}
static inline void
timevar_pop (timevar_id_t tv)
{
if (timevar_enable)
timevar_pop_1 (tv);
}
extern void print_time (const char *, long);
extern bool timevar_enable;
extern size_t timevar_ggc_mem_total;
#endif /* ! GCC_TIMEVAR_H */