Make it clearer when we're accessing member data of pass_manager by adding an "m"_ prefix to the fields handled via passes.def macros.
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-254-g1dc8916bcbb14c. gcc/ChangeLog: * pass_manager.h (class pass_manager): Add "m_" prefix to all pass fields. * passes.cc (pass_manager::execute_early_local_passes): Update for added "m_" prefix. (pass_manager::execute_pass_mode_switching): Likewise. (pass_manager::finish_optimization_passes): Likewise. (pass_manager::pass_manager): Likewise. (pass_manager::dump_profile_report): Likewise. Signed-off-by: David Malcolm <dmalc...@redhat.com> --- gcc/pass_manager.h | 20 ++++++++++---------- gcc/passes.cc | 34 +++++++++++++++++----------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/gcc/pass_manager.h b/gcc/pass_manager.h index 5fb7b0945d3..d4f89004559 100644 --- a/gcc/pass_manager.h +++ b/gcc/pass_manager.h @@ -67,13 +67,13 @@ public: /* Various passes are manually cloned by avr and epiphany. */ opt_pass *get_pass_split_all_insns () const { - return pass_split_all_insns_1; + return m_pass_split_all_insns_1; } opt_pass *get_pass_mode_switching () const { - return pass_mode_switching_1; + return m_pass_mode_switching_1; } - opt_pass *get_pass_peephole2 () const { return pass_peephole2_1; } - opt_pass *get_pass_profile () const { return pass_profile_1; } + opt_pass *get_pass_peephole2 () const { return m_pass_peephole2_1; } + opt_pass *get_pass_profile () const { return m_pass_profile_1; } void register_pass_name (opt_pass *pass, const char *name); @@ -81,9 +81,9 @@ public: opt_pass *get_rest_of_compilation () const { - return pass_rest_of_compilation_1; + return m_pass_rest_of_compilation_1; } - opt_pass *get_clean_slate () const { return pass_clean_state_1; } + opt_pass *get_clean_slate () const { return m_pass_clean_state_1; } public: /* The root of the compilation pass tree, once constructed. */ @@ -114,21 +114,21 @@ private: For example: NEXT_PASS (pass_build_cfg, 1); within pass-instances.def means that there is a field: - opt_pass *pass_build_cfg_1; + opt_pass *m_pass_build_cfg_1; Similarly, the various: NEXT_PASS (pass_copy_prop, 1); ... NEXT_PASS (pass_copy_prop, 8); in pass-instances.def lead to fields: - opt_pass *pass_copy_prop_1; + opt_pass *m_pass_copy_prop_1; ... - opt_pass *pass_copy_prop_8; */ + opt_pass *m_pass_copy_prop_8; */ #define INSERT_PASSES_AFTER(PASS) #define PUSH_INSERT_PASSES_WITHIN(PASS, NUM) #define POP_INSERT_PASSES() -#define NEXT_PASS(PASS, NUM) opt_pass *PASS ## _ ## NUM +#define NEXT_PASS(PASS, NUM) opt_pass *m_ ## PASS ## _ ## NUM #define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) NEXT_PASS (PASS, NUM) #define NEXT_PASS_WITH_ARGS(PASS, NUM, ...) NEXT_PASS (PASS, NUM) #define TERMINATE_PASS_LIST(PASS) diff --git a/gcc/passes.cc b/gcc/passes.cc index 3c28db78f09..0482de0b198 100644 --- a/gcc/passes.cc +++ b/gcc/passes.cc @@ -116,14 +116,14 @@ opt_pass::opt_pass (const pass_data &data, context *ctxt) void pass_manager::execute_early_local_passes () { - execute_pass_list (cfun, pass_build_ssa_passes_1->sub); - execute_pass_list (cfun, pass_local_optimization_passes_1->sub); + execute_pass_list (cfun, m_pass_build_ssa_passes_1->sub); + execute_pass_list (cfun, m_pass_local_optimization_passes_1->sub); } unsigned int pass_manager::execute_pass_mode_switching () { - return pass_mode_switching_1->execute (cfun); + return m_pass_mode_switching_1->execute (cfun); } @@ -355,9 +355,9 @@ finish_optimization_passes (void) if (coverage_instrumentation_p () || flag_test_coverage || flag_branch_probabilities) { - dumps->dump_start (pass_profile_1->static_pass_number, NULL); + dumps->dump_start (m_pass_profile_1->static_pass_number, NULL); end_branch_prob (); - dumps->dump_finish (pass_profile_1->static_pass_number); + dumps->dump_finish (m_pass_profile_1->static_pass_number); } /* Do whatever is necessary to finish printing the graphs. */ @@ -1587,7 +1587,7 @@ pass_manager::pass_manager (context *ctxt) #define INSERT_PASSES_AFTER(PASS) #define PUSH_INSERT_PASSES_WITHIN(PASS, NUM) #define POP_INSERT_PASSES() -#define NEXT_PASS(PASS, NUM) PASS ## _ ## NUM = NULL +#define NEXT_PASS(PASS, NUM) m_ ## PASS ## _ ## NUM = NULL #define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) NEXT_PASS (PASS, NUM) #define NEXT_PASS_WITH_ARGS(PASS, NUM, ...) NEXT_PASS (PASS, NUM) #define TERMINATE_PASS_LIST(PASS) @@ -1612,28 +1612,28 @@ pass_manager::pass_manager (context *ctxt) #define PUSH_INSERT_PASSES_WITHIN(PASS, NUM) \ { \ - opt_pass **p = &(PASS ## _ ## NUM)->sub; + opt_pass **p = &(m_ ## PASS ## _ ## NUM)->sub; #define POP_INSERT_PASSES() \ } #define NEXT_PASS(PASS, NUM) \ do { \ - gcc_assert (PASS ## _ ## NUM == NULL); \ + gcc_assert (m_ ## PASS ## _ ## NUM == NULL); \ if ((NUM) == 1) \ - PASS ## _1 = make_##PASS (m_ctxt); \ + m_ ## PASS ## _1 = make_##PASS (m_ctxt); \ else \ { \ - gcc_assert (PASS ## _1); \ - PASS ## _ ## NUM = PASS ## _1->clone (); \ + gcc_assert (m_ ## PASS ## _1); \ + m_ ## PASS ## _ ## NUM = m_ ## PASS ## _1->clone (); \ } \ - p = next_pass_1 (p, PASS ## _ ## NUM, PASS ## _1); \ + p = next_pass_1 (p, m_ ## PASS ## _ ## NUM, m_ ## PASS ## _1); \ } while (0) #define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) \ do { \ NEXT_PASS (PASS, NUM); \ - PASS ## _ ## NUM->set_pass_param (0, ARG); \ + m_ ## PASS ## _ ## NUM->set_pass_param (0, ARG); \ } while (0) #define NEXT_PASS_WITH_ARGS(PASS, NUM, ...) \ @@ -1643,7 +1643,7 @@ pass_manager::pass_manager (context *ctxt) unsigned i = 0; \ for (bool value : values) \ { \ - PASS ## _ ## NUM->set_pass_param (i, value); \ + m_ ## PASS ## _ ## NUM->set_pass_param (i, value); \ i++; \ } \ } while (0) @@ -2020,7 +2020,7 @@ pass_manager::dump_profile_report () const fprintf (dump_file, " "); /* Size/time units change across gimple and RTL. */ - if (i == pass_expand_1->static_pass_number) + if (i == m_pass_expand_1->static_pass_number) fprintf (dump_file, "|-------------------|--------------------------"); else @@ -2032,8 +2032,8 @@ pass_manager::dump_profile_report () const fprintf (dump_file, " "); fprintf (dump_file, "| %12.0f", profile_record[i].time); /* Time units changes with profile estimate and feedback. */ - if (i == pass_profile_1->static_pass_number - || i == pass_ipa_tree_profile_1->static_pass_number) + if (i == m_pass_profile_1->static_pass_number + || i == m_pass_ipa_tree_profile_1->static_pass_number) fprintf (dump_file, "-------------"); else if (rel_time_change) fprintf (dump_file, " %+11.1f%%", rel_time_change); -- 2.26.3