From e0cb7e1ef4a76a9e65d023fa380f7d3525a66443 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Tue, 21 Dec 2010 22:58:57 +0000 Subject: value-prof.c (value_prof_hooks): Remove. * value-prof.c (value_prof_hooks): Remove. (struct value_prof_hooks): Remove. (gimple_value_prof_hooks): Remove. (gimple_register_value_prof_hooks): Remove. (find_values_to_profile): Remove. (value_profile_transformations): Remove. (gimple_value_profile_transformations): No longer static. (gimple_find_values_to_profile): Likewise. * value-prof.h (gimple_register_value_prof_hooks): Remove prototype. (find_values_to_profile): Likewise. (value_profile_transformations): Likewise. (tree_register_profile_hooks): Likewise. (struct profile_hooks): Remove. (tree_profile_hooks): Remove. (gimple_find_values_to_profile): New protoype. (gimple_value_profile_transformations): Likewise. (gimple_init_edge_profiler): Likewise. (gimple_gen_edge_profiler): Likewise. (gimple_gen_interval_profiler): Likewise. (gimple_gen_pow2_profiler): Likewise. (gimple_gen_one_value_profiler): Likewise. (gimple_gen_ic_profiler): Likewise. (gimple_gen_ic_func_profiler): Likewise. (gimple_gen_const_delta_profiler): Likewise. (gimple_gen_average_profiler): Likewise. (gimple_gen_ior_profiler): Likewise. * profile.c (profile_hooks): Remove. (instrument_edges): Call profiling functions directly instead of through removed profile_hooks. (instrument_values): Likewise. (branch_prob): Call gimple_find_values_to_profile instead of removed find_values_to_profile. Call gimple_init_edge_profiler instead of removed hook. (tree_register_profile_hooks): Remove. * tree-profile.c (tree_init_ic_make_global_vars): Rename to init_ic_make_global_vars. (tree_init_edge_profiler): Rename to gimple_init_edge_profiler and no longer static. (tree_gen_edge_profiler, tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, tree_gen_ic_profiler, tree_gen_ic_func_profiler, tree_gen_const_delta_profiler, tree_gen_average_profiler, tree_gen_ior_profiler): Similarly renamed and no longer static. (tree_profiling): Do not initialize tree profiling hooks. (tree_profile_hooks): Remove. From-SVN: r168141 --- gcc/profile.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'gcc/profile.c') diff --git a/gcc/profile.c b/gcc/profile.c index 606e3b2..bde8b46 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -72,9 +72,6 @@ along with GCC; see the file COPYING3. If not see #include "profile.h" -/* Hooks for profiling. */ -static struct profile_hooks* profile_hooks; - struct bb_info { unsigned int count_valid : 1; @@ -141,7 +138,7 @@ instrument_edges (struct edge_list *el) fprintf (dump_file, "Edge %d to %d instrumented%s\n", e->src->index, e->dest->index, EDGE_CRITICAL_P (e) ? " (and split)" : ""); - (profile_hooks->gen_edge_profiler) (num_instr_edges++, e); + gimple_gen_edge_profiler (num_instr_edges++, e); } } } @@ -202,31 +199,31 @@ instrument_values (histogram_values values) switch (hist->type) { case HIST_TYPE_INTERVAL: - (profile_hooks->gen_interval_profiler) (hist, t, 0); + gimple_gen_interval_profiler (hist, t, 0); break; case HIST_TYPE_POW2: - (profile_hooks->gen_pow2_profiler) (hist, t, 0); + gimple_gen_pow2_profiler (hist, t, 0); break; case HIST_TYPE_SINGLE_VALUE: - (profile_hooks->gen_one_value_profiler) (hist, t, 0); + gimple_gen_one_value_profiler (hist, t, 0); break; case HIST_TYPE_CONST_DELTA: - (profile_hooks->gen_const_delta_profiler) (hist, t, 0); + gimple_gen_const_delta_profiler (hist, t, 0); break; case HIST_TYPE_INDIR_CALL: - (profile_hooks->gen_ic_profiler) (hist, t, 0); + gimple_gen_ic_profiler (hist, t, 0); break; case HIST_TYPE_AVERAGE: - (profile_hooks->gen_average_profiler) (hist, t, 0); + gimple_gen_average_profiler (hist, t, 0); break; case HIST_TYPE_IOR: - (profile_hooks->gen_ior_profiler) (hist, t, 0); + gimple_gen_ior_profiler (hist, t, 0); break; default: @@ -1170,7 +1167,7 @@ branch_prob (void) #undef BB_TO_GCOV_INDEX if (flag_profile_values) - find_values_to_profile (&values); + gimple_find_values_to_profile (&values); if (flag_branch_probabilities) { @@ -1187,7 +1184,7 @@ branch_prob (void) { unsigned n_instrumented; - profile_hooks->init_edge_profiler (); + gimple_init_edge_profiler (); n_instrumented = instrument_edges (el); @@ -1372,11 +1369,3 @@ end_branch_prob (void) } } -/* Set up hooks to enable tree-based profiling. */ - -void -tree_register_profile_hooks (void) -{ - gcc_assert (current_ir_type () == IR_GIMPLE); - profile_hooks = &tree_profile_hooks; -} -- cgit v1.1