Commit 3fa3690d by Oleg Endo

passes.c (register_pass): Add overload.

	* passes.c (register_pass): Add overload.
	* tree-pass.h (register_pass): Forward declare it.  Add comment.

From-SVN: r202081
parent 125b62f6
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> 2013-08-29 Jan Hubicka <jh@suse.cz>
* lto-streamer-out.c (hash_tree): Stream DECL_FINAL_P. * lto-streamer-out.c (hash_tree): Stream DECL_FINAL_P.
......
...@@ -1370,7 +1370,19 @@ void ...@@ -1370,7 +1370,19 @@ void
register_pass (struct register_pass_info *pass_info) register_pass (struct register_pass_info *pass_info)
{ {
g->get_passes ()->register_pass (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 void
......
...@@ -91,7 +91,8 @@ public: ...@@ -91,7 +91,8 @@ public:
virtual opt_pass *clone (); virtual opt_pass *clone ();
/* If has_gate is set, this pass and all sub-passes are executed only if /* 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 (); virtual bool gate ();
/* This is the code to run. If has_execute is false, then there should /* This is the code to run. If has_execute is false, then there should
...@@ -330,6 +331,14 @@ struct register_pass_info ...@@ -330,6 +331,14 @@ struct register_pass_info
enum pass_positioning_ops pos_op; /* how to insert the new pass. */ 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_1 (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_mudflap_2 (gcc::context *ctxt); extern gimple_opt_pass *make_pass_mudflap_2 (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt); extern gimple_opt_pass *make_pass_asan (gcc::context *ctxt);
...@@ -594,7 +603,6 @@ extern void ipa_read_summaries (void); ...@@ -594,7 +603,6 @@ extern void ipa_read_summaries (void);
extern void ipa_read_optimization_summaries (void); extern void ipa_read_optimization_summaries (void);
extern void register_one_dump_file (struct opt_pass *); extern void register_one_dump_file (struct opt_pass *);
extern bool function_called_by_processed_nodes_p (void); 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 /* 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 current function. Note that using this information in the optimization
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment