diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2013-08-29 18:29:33 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2013-08-29 18:29:33 +0000 |
commit | 9fcc1e657253931a676ab597b8ee4c94f4e7203a (patch) | |
tree | 2750218e06eb7e348f2514611f0b4682c34c841e | |
parent | 23dbddafbd288eed8775924c0726553dd18a1bc7 (diff) |
* passes.c (register_pass): Add overload.
* tree-pass.h (register_pass): Forward declare it. Add comment.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@202081 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/passes.c | 12 | ||||
-rw-r--r-- | gcc/tree-pass.h | 12 |
3 files changed, 27 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c92fd0e3b1..c5ffeadd8f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-08-29 Oleg Endo <olegendo@gcc.gnu.org> + + * passes.c (register_pass): Add overload. + * tree-pass.h (register_pass): Forward declare it. Add comment. + 2013-08-29 Jan Hubicka <jh@suse.cz> * lto-streamer-out.c (hash_tree): Stream DECL_FINAL_P. diff --git a/gcc/passes.c b/gcc/passes.c index bffff412c17..5b4975267eb 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1370,7 +1370,19 @@ void register_pass (struct register_pass_info *pass_info) { g->get_passes ()->register_pass (pass_info); +} + +void +register_pass (opt_pass* pass, pass_positioning_ops pos, + const char* ref_pass_name, int ref_pass_inst_number) +{ + register_pass_info i; + i.pass = pass; + i.reference_pass_name = ref_pass_name; + i.ref_pass_instance_number = ref_pass_inst_number; + i.pos_op = pos; + g->get_passes ()->register_pass (&i); } void diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 787a49b7c41..a6d8a8311a6 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -91,7 +91,8 @@ public: virtual opt_pass *clone (); /* If has_gate is set, this pass and all sub-passes are executed only if - the function returns true. */ + the function returns true. + The default implementation returns true. */ virtual bool gate (); /* This is the code to run. If has_execute is false, then there should @@ -330,6 +331,14 @@ struct register_pass_info enum pass_positioning_ops pos_op; /* how to insert the new pass. */ }; +/* Registers a new pass. Either fill out the register_pass_info or specify + the individual parameters. The pass object is expected to have been + allocated using operator new and the pass manager takes the ownership of + the pass object. */ +extern void register_pass (register_pass_info *); +extern void register_pass (opt_pass* pass, pass_positioning_ops pos, + const char* ref_pass_name, int ref_pass_inst_number); + extern gimple_opt_pass *make_pass_mudflap_1 (gcc::context *ctxt); extern gimple_opt_pass *make_pass_mudflap_2 (gcc::context *ctxt); extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt); @@ -594,7 +603,6 @@ extern void ipa_read_summaries (void); extern void ipa_read_optimization_summaries (void); extern void register_one_dump_file (struct opt_pass *); extern bool function_called_by_processed_nodes_p (void); -extern void register_pass (struct register_pass_info *); /* Set to true if the pass is called the first time during compilation of the current function. Note that using this information in the optimization |