OSDN Git Service

* pt.c (print_template_statistics): New.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Apr 2010 15:54:29 +0000 (15:54 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:49:48 +0000 (09:49 +0900)
* cp-tree.h: Declare it.
* tree.c (cxx_print_statistics): Call it.

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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c

index a6e6f3a..d3b0788 100644 (file)
@@ -1,5 +1,9 @@
 2010-04-07  Jason Merrill  <jason@redhat.com>
 
+       * pt.c (print_template_statistics): New.
+       * cp-tree.h: Declare it.
+       * tree.c (cxx_print_statistics): Call it.
+
        PR c++/41970
        * decl.c (grokvardecl): Tweak warning message.
        (grokfndecl): Likewise.
index 6334673..1350619 100644 (file)
@@ -4975,6 +4975,7 @@ extern void pop_tinst_level                     (void);
 extern struct tinst_level *outermost_tinst_level(void);
 extern bool parameter_of_template_p            (tree, tree);
 extern void init_template_processing           (void);
+extern void print_template_statistics          (void);
 bool template_template_parameter_p             (const_tree);
 extern bool primary_template_instantiation_p    (const_tree);
 extern tree get_primary_template_innermost_parameters  (const_tree);
index 13bb5aa..d1c33d6 100644 (file)
@@ -18554,4 +18554,19 @@ init_template_processing (void)
                                          ggc_free);
 }
 
+/* Print stats about the template hash tables for -fstats.  */
+
+void
+print_template_statistics (void)
+{
+  fprintf (stderr, "decl_specializations: size %ld, %ld elements, "
+          "%f collisions\n", (long) htab_size (decl_specializations),
+          (long) htab_elements (decl_specializations),
+          htab_collisions (decl_specializations));
+  fprintf (stderr, "type_specializations: size %ld, %ld elements, "
+          "%f collisions\n", (long) htab_size (type_specializations),
+          (long) htab_elements (type_specializations),
+          htab_collisions (type_specializations));
+}
+
 #include "gt-cp-pt.h"