diff options
author | David Malcolm <dmalcolm@redhat.com> | 2013-08-05 20:01:43 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2013-08-05 20:01:43 +0000 |
commit | f7695dbf402847104b2330126a3c61fae199cc1a (patch) | |
tree | cdd5686bbad14a7a9b7c4e8de621c8b7b8826c56 /gcc/config | |
parent | d0b2f8311e5e1917464aa4f65d506fbe4e580eb1 (diff) | |
download | gcc-f7695dbf402847104b2330126a3c61fae199cc1a.zip gcc-f7695dbf402847104b2330126a3c61fae199cc1a.tar.gz gcc-f7695dbf402847104b2330126a3c61fae199cc1a.tar.bz2 |
Handwritten part of conversion of passes to C++ classes
gcc/
* Makefile.in (PASS_MANAGER_H): Add dep on pass-instances.def.
(toplev.o): Add dep on PASS_MANAGER_H.
* cgraphunit.c (cgraph_process_new_functions): Rework invocation
of early local pases to reflect this moving from a global to a
member of gcc::pass_manager.
(cgraph_add_new_function): Likewise.
* lto-cgraph.c (lto_output_node): Update for conversion of
struct ipa_opt_pass_d to a C++ subclass of opt_pass.
* passes.c (opt_pass::clone): New.
(opt_pass::gate): New.
(opt_pass::execute): New.
(opt_pass::opt_pass): New.
(pass_manager::execute_early_local_passes): New.
(pass_manager::execute_pass_mode_switching): new.
(finish_optimization_passes): Convert to...
(pass_manager::finish_optimization_passes): ...this.
(finish_optimization_passes): Update for conversion of passes to
C++ classes.
(register_dump_files_1): Use has_gate since we cannot portably
check a vtable entry against NULL.
(dump_one_pass): Likewise.
(ipa_write_summaries_2): Likewise.
(ipa_write_optimization_summaries_1): Likewise.
(ipa_read_summaries_1): Likewise.
(ipa_read_optimization_summaries_1): Likewise.
(execute_ipa_stmt_fixups): Likewise.
(pass_manager::pass_manager): Rewrite pass-creation, invoking
pass-creation functions rather than wiring up globals, and
storing the results in fields of pass_manager generated using
pass-instances.def.
(pass_manager::dump_profile_report): Update for conversion of
passes to C++ classes.
(pass_manager::execute_ipa_summary_passes): Likewise.
(execute_one_ipa_transform_pass): Likewise.
(execute_one_pass): Use has_gate and has_execute since we cannot
portably check a vtable entry against NULL.
* pass_manager.h (pass_manager::finish_optimization_passes): New.
(pass_manager): Use pass-instances.def to add fields for the
various pass instances.
* toplev.c (finalize): Update for move of
finish_optimization_passes to a method of gcc::pass_manager.
* toplev.h (finish_optimization_passes): Move to method of class
pass_manager.
* tree-pass.h (struct pass_data): New.
(opt_pass): Convert to C++ class, make it a subclass of
pass_data.
(opt_pass::gate): Convert to virtual function.
(opt_pass::~opt_pass): New.
(opt_pass::clone): New.
(opt_pass::execute): Convert to virtual function.
(opt_pass::opt_pass): New.
(opt_pass::ctxt_): new.
(gimple_opt_pass): Convert to subclass of opt_pass.
(gimple_opt_pass::gimple_opt_pass): New.
(rtl_opt_pass): Convert to subclass of opt_pass.
(rtl_opt_pass::rtl_opt_pass): New.
(ipa_opt_pass_d): Convert to subclass of opt_pass.
(ipa_opt_pass_d::ipa_opt_pass_d): New.
(simple_ipa_opt_pass): Convert to subclass of opt_pass.
(simple_ipa_opt_pass::simple_ipa_opt_pass): New.
* config/i386/i386.c (rest_of_handle_insert_vzeroupper): Rework
invocation of pass_mode_switching to reflect this moving from a
global to a member of gcc::pass_manager.
(ix86_option_override): Rework how pass_insert_vzeroupper is
added to the pass_manager to reflect autogenerated changes.
* config/i386/t-i386 (i386.o) Add deps on CONTEXT_H and
PASS_MANAGER_H.
gcc/testsuite/
* g++.dg/plugin/dumb_plugin.c (plugin_init): Rework how the pass
is created and added to the pass_manager to reflect
autogenerated changes.
* g++.dg/plugin/selfassign.c (plugin_init): Likewise.
* gcc.dg/plugin/one_time_plugin.c (plugin_init): Likewise.
* gcc.dg/plugin/selfassign.c (plugin_init): Likewise.
From-SVN: r201505
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 7 | ||||
-rw-r--r-- | gcc/config/i386/t-i386 | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index df79eac..cce3c9c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -62,6 +62,8 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "tree-pass.h" #include "tree-flow.h" +#include "context.h" +#include "pass_manager.h" static rtx legitimize_dllimport_symbol (rtx, bool); static rtx legitimize_pe_coff_extern_decl (rtx, bool); @@ -2596,7 +2598,7 @@ rest_of_handle_insert_vzeroupper (void) ix86_optimize_mode_switching[AVX_U128] = 1; /* Call optimize_mode_switching. */ - pass_mode_switching.pass.execute (); + g->get_passes ()->execute_pass_mode_switching (); return 0; } @@ -4028,8 +4030,9 @@ ix86_option_override_internal (bool main_args_p) static void ix86_option_override (void) { + opt_pass *pass_insert_vzeroupper = make_pass_insert_vzeroupper (g); static struct register_pass_info insert_vzeroupper_info - = { &pass_insert_vzeroupper.pass, "reload", + = { pass_insert_vzeroupper, "reload", 1, PASS_POS_INSERT_AFTER }; diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386 index 3a77e14..f10d570 100644 --- a/gcc/config/i386/t-i386 +++ b/gcc/config/i386/t-i386 @@ -24,7 +24,7 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h dumpfile.h $(TM_H) \ $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \ $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) \ i386-builtin-types.inc debug.h dwarf2out.h sbitmap.h $(FIBHEAP_H) \ - $(OPTS_H) $(DIAGNOSTIC_H) $(COMMON_TARGET_H) + $(OPTS_H) $(DIAGNOSTIC_H) $(COMMON_TARGET_H) $(CONTEXT_H) $(PIPELINE_H) i386-c.o: $(srcdir)/config/i386/i386-c.c \ $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \ |