summaryrefslogtreecommitdiff
path: root/gcc/ggc-common.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@gcc.gnu.org>2010-04-13 09:30:31 -0400
committerDiego Novillo <dnovillo@gcc.gnu.org>2010-04-13 09:30:31 -0400
commit10d43c2d1b58300b12209abc980ea2ed3a414be6 (patch)
tree7d6bdf3659c4ca2ac9b6e81c946d8961451da717 /gcc/ggc-common.c
parent143597ffdaaf5ffc45f0940263704127ef3aa671 (diff)
downloadgcc-10d43c2d1b58300b12209abc980ea2ed3a414be6.tar.gz
Makefile.in (c-pch.o, [...]): Depend on timevar.h.
2010-04-12 Diego Novillo <dnovillo@google.com> * Makefile.in (c-pch.o, ggc-common.o): Depend on timevar.h. * c-pch.c: Include timevar.h. (c_common_write_pch): Use TV_PCH_SAVE and TV_PCH_CPP_SAVE timers. (c_common_read_pch): Use TV_PCH_RESTORE and TV_PCH_CPP_RESTORE timers. * ggc-common.c: Include timevar.h. (gt_pch_save): Use TV_PCH_PTR_REALLOC and TV_PCH_PTR_SORT timers. * timevar.def (TV_PCH_SAVE): Define. (TV_PCH_CPP_SAVE): Define. (TV_PCH_PTR_REALLOC): Define. (TV_PCH_PTR_SORT): Define. (TV_PCH_RESTORE): Define. (TV_PCH_CPP_RESTORE): Define. From-SVN: r158266
Diffstat (limited to 'gcc/ggc-common.c')
-rw-r--r--gcc/ggc-common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index fc42f45d59c..28c2b793f22 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "hosthooks-def.h"
#include "plugin.h"
#include "vec.h"
+#include "timevar.h"
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
@@ -501,6 +502,7 @@ gt_pch_save (FILE *f)
gt_pch_save_stringpool ();
+ timevar_push (TV_PCH_PTR_REALLOC);
saving_htab = htab_create (50000, saving_htab_hash, saving_htab_eq, free);
for (rt = gt_ggc_rtab; *rt; rt++)
@@ -532,8 +534,13 @@ gt_pch_save (FILE *f)
state.ptrs = XNEWVEC (struct ptr_data *, state.count);
state.ptrs_i = 0;
+
htab_traverse (saving_htab, call_alloc, &state);
+ timevar_pop (TV_PCH_PTR_REALLOC);
+
+ timevar_push (TV_PCH_PTR_SORT);
qsort (state.ptrs, state.count, sizeof (*state.ptrs), compare_ptr_data);
+ timevar_pop (TV_PCH_PTR_SORT);
/* Write out all the scalar variables. */
for (rt = gt_pch_scalar_rtab; *rt; rt++)