class.c: Remove unused global variables.
authorMarek Polacek <polacek@redhat.com>
Mon, 5 Feb 2018 11:47:48 +0000 (11:47 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 5 Feb 2018 11:47:48 +0000 (11:47 +0000)
* class.c: Remove unused global variables.
        (build_primary_vtable): Don't gather statistics.
(print_class_statistics): Remove.
* cp-tree.h (print_class_statistics): Remove.
* tree.c (cxx_print_statistics): Don't call print_class_statistics.

From-SVN: r257389

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

index 0681826cd4c1135667f44ab8272875912e0d5387..2dc96a3b6907d160f261cbd36395f642423874fa 100644 (file)
@@ -1,3 +1,11 @@
+2018-02-05  Marek Polacek  <polacek@redhat.com>
+
+       * class.c: Remove unused global variables.
+       (build_primary_vtable): Don't gather statistics.
+       (print_class_statistics): Remove.
+       * cp-tree.h (print_class_statistics): Remove.
+       * tree.c (cxx_print_statistics): Don't call print_class_statistics.
+
 2018-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * class.c (is_really_empty_class): Use DECL_UNNAMED_BIT_FIELD.
index a4098ac872eeb7a08950d20acd91741961f6b140..6012b8deff91025466e0a2c5ce29fbd95236239d 100644 (file)
@@ -215,16 +215,6 @@ static tree end_of_base (tree);
 static tree get_vcall_index (tree, tree);
 static bool type_maybe_constexpr_default_constructor (tree);
 
-/* Variables shared between class.c and call.c.  */
-
-int n_vtables = 0;
-int n_vtable_entries = 0;
-int n_vtable_searches = 0;
-int n_vtable_elems = 0;
-int n_convert_harshness = 0;
-int n_compute_conversion_costs = 0;
-int n_inner_fields_searched = 0;
-
 /* Return a COND_EXPR that executes TRUE_STMT if this execution of the
    'structor is in charge of 'structing virtual bases, or FALSE_STMT
    otherwise.  */
@@ -892,12 +882,6 @@ build_primary_vtable (tree binfo, tree type)
       virtuals = NULL_TREE;
     }
 
-  if (GATHER_STATISTICS)
-    {
-      n_vtables += 1;
-      n_vtable_elems += list_length (virtuals);
-    }
-
   /* Initialize the association list for this type, based
      on our first approximation.  */
   BINFO_VTABLE (TYPE_BINFO (type)) = decl;
@@ -8118,23 +8102,6 @@ get_vfield_name (tree type)
   return get_identifier (buf);
 }
 
-void
-print_class_statistics (void)
-{
-  if (! GATHER_STATISTICS)
-    return;
-
-  fprintf (stderr, "convert_harshness = %d\n", n_convert_harshness);
-  fprintf (stderr, "compute_conversion_costs = %d\n", n_compute_conversion_costs);
-  if (n_vtables)
-    {
-      fprintf (stderr, "vtables = %d; vtable searches = %d\n",
-              n_vtables, n_vtable_searches);
-      fprintf (stderr, "vtable entries = %d; vtable elems = %d\n",
-              n_vtable_entries, n_vtable_elems);
-    }
-}
-
 /* Build a dummy reference to ourselves so Derived::Base (and A::A) works,
    according to [class]:
                                          The class-name is also inserted
index a53f4fd9c03a13eb0303a77f433695d406e773c3..861efb3053b5986071c72c4f8a4d22cd63bba97f 100644 (file)
@@ -6040,7 +6040,6 @@ extern int current_lang_depth                     (void);
 extern void push_lang_context                  (tree);
 extern void pop_lang_context                   (void);
 extern tree instantiate_type                   (tree, tree, tsubst_flags_t);
-extern void print_class_statistics             (void);
 extern void build_self_reference               (void);
 extern int same_signature_p                    (const_tree, const_tree);
 extern void maybe_add_class_template_decl_list (tree, tree, int);
index c212c80ecf8e8e27a09f92c223efa00b066d4d64..d85f934f2de4d4d1a1d7d961fb122214309776e4 100644 (file)
@@ -2831,7 +2831,6 @@ extern int depth_reached;
 void
 cxx_print_statistics (void)
 {
-  print_class_statistics ();
   print_template_statistics ();
   if (GATHER_STATISTICS)
     fprintf (stderr, "maximum template instantiation depth reached: %d\n",