From 84ac4dfc5d5ed40758261a9adac3f824d955546c Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 23 Aug 2017 19:33:08 +0000 Subject: [PATCH] cp-tree.h (print_search_statistics, [...]): Don't declare. * cp-tree.h (print_search_statistics, reinit_search_statistics): Don't declare. * search.c (n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1, n_calls_lookup_fnfields, n_calls_lookup_fnfields_1, n_calls_get_base_type, n_outer_fields_searched, n_contexts_saved): Delete. (lookup_field_1, lookup_member, lookup_fnfields_slot_nolazy): Remove stat gathering. (print_search_statistics, reinit_search_statistics): Delete. * tree.c (cxx_print_statistics): Don't print search stats. From-SVN: r251315 --- gcc/cp/ChangeLog | 13 +++++++++++ gcc/cp/cp-tree.h | 2 -- gcc/cp/search.c | 56 ------------------------------------------------ gcc/cp/tree.c | 1 - 4 files changed, 13 insertions(+), 59 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dd94fdb1c4e..7b82a61b13c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2017-08-23 Nathan Sidwell + + * cp-tree.h (print_search_statistics, + reinit_search_statistics): Don't declare. + * search.c (n_fields_searched, n_calls_lookup_field, + n_calls_lookup_field_1, n_calls_lookup_fnfields, + n_calls_lookup_fnfields_1, n_calls_get_base_type, + n_outer_fields_searched, n_contexts_saved): Delete. + (lookup_field_1, lookup_member, + lookup_fnfields_slot_nolazy): Remove stat gathering. + (print_search_statistics, reinit_search_statistics): Delete. + * tree.c (cxx_print_statistics): Don't print search stats. + 2017-08-21 Nathan Sidwell * search.c (lookup_field_r): Remove obsolete code for type-named diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 4dd9fc6628f..fb9dadef34b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6577,8 +6577,6 @@ extern int look_for_overrides (tree, tree); extern void get_pure_virtuals (tree); extern void maybe_suppress_debug_info (tree); extern void note_debug_info_needed (tree); -extern void print_search_statistics (void); -extern void reinit_search_statistics (void); extern tree current_scope (void); extern int at_function_scope_p (void); extern bool at_class_scope_p (void); diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 6628a1b2291..bb2219fb040 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -51,15 +51,6 @@ static tree dfs_access_in_type (tree, void *); static access_kind access_in_type (tree, tree); static tree dfs_get_pure_virtuals (tree, void *); - -/* Variables for gathering statistics. */ -static int n_fields_searched; -static int n_calls_lookup_field, n_calls_lookup_field_1; -static int n_calls_lookup_fnfields, n_calls_lookup_fnfields_1; -static int n_calls_get_base_type; -static int n_outer_fields_searched; -static int n_contexts_saved; - /* Data for lookup_base and its workers. */ @@ -383,9 +374,6 @@ lookup_field_1 (tree type, tree name, bool want_type) { i = (lo + hi) / 2; - if (GATHER_STATISTICS) - n_fields_searched++; - if (DECL_NAME (fields[i]) > name) hi = i; else if (DECL_NAME (fields[i]) < name) @@ -428,9 +416,6 @@ lookup_field_1 (tree type, tree name, bool want_type) field = TYPE_FIELDS (type); - if (GATHER_STATISTICS) - n_calls_lookup_field_1++; - for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) { tree decl = field; @@ -439,9 +424,6 @@ lookup_field_1 (tree type, tree name, bool want_type) /* Functions are kep separately, at the moment. */ continue; - if (GATHER_STATISTICS) - n_fields_searched++; - gcc_assert (DECL_P (field)); if (DECL_NAME (field) == NULL_TREE && ANON_AGGR_TYPE_P (TREE_TYPE (field))) @@ -1262,9 +1244,6 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type, if (!basetype_path) return NULL_TREE; - if (GATHER_STATISTICS) - n_calls_lookup_field++; - memset (&lfi, 0, sizeof (lfi)); lfi.type = type; lfi.name = name; @@ -1523,9 +1502,6 @@ lookup_fnfields_slot_nolazy (tree type, tree name) if (!method_vec) return NULL_TREE; - if (GATHER_STATISTICS) - n_calls_lookup_fnfields_1++; - if (IDENTIFIER_CONV_OP_P (name)) return lookup_conversion_operator (type, TREE_TYPE (name)); @@ -1550,9 +1526,6 @@ lookup_fnfields_slot_nolazy (tree type, tree name) { i = (lo + hi) / 2; - if (GATHER_STATISTICS) - n_outer_fields_searched++; - fns = (*method_vec)[i]; tree fn_name = OVL_NAME (fns); if (fn_name > name) @@ -1566,8 +1539,6 @@ lookup_fnfields_slot_nolazy (tree type, tree name) else for (; vec_safe_iterate (method_vec, i, &fns); ++i) { - if (GATHER_STATISTICS) - n_outer_fields_searched++; if (OVL_NAME (fns) == name) return fns; } @@ -2501,33 +2472,6 @@ note_debug_info_needed (tree type) dfs_walk_all (TYPE_BINFO (type), dfs_debug_mark, NULL, 0); } -void -print_search_statistics (void) -{ - if (! GATHER_STATISTICS) - { - fprintf (stderr, "no search statistics\n"); - return; - } - - fprintf (stderr, "%d fields searched in %d[%d] calls to lookup_field[_1]\n", - n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1); - fprintf (stderr, "%d fnfields searched in %d calls to lookup_fnfields\n", - n_outer_fields_searched, n_calls_lookup_fnfields); - fprintf (stderr, "%d calls to get_base_type\n", n_calls_get_base_type); -} - -void -reinit_search_statistics (void) -{ - n_fields_searched = 0; - n_calls_lookup_field = 0, n_calls_lookup_field_1 = 0; - n_calls_lookup_fnfields = 0, n_calls_lookup_fnfields_1 = 0; - n_calls_get_base_type = 0; - n_outer_fields_searched = 0; - n_contexts_saved = 0; -} - /* Helper for lookup_conversions_r. TO_TYPE is the type converted to by a conversion op in base BINFO. VIRTUAL_DEPTH is nonzero if BINFO is morally virtual, and VIRTUALNESS is nonzero if virtual diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 8f18665da41..dbac7f3c550 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2818,7 +2818,6 @@ extern int depth_reached; void cxx_print_statistics (void) { - print_search_statistics (); print_class_statistics (); print_template_statistics (); if (GATHER_STATISTICS) -- 2.30.2