passes.c (register_pass): Add overload.
authorOleg Endo <olegendo@gcc.gnu.org>
Thu, 29 Aug 2013 18:29:33 +0000 (18:29 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Thu, 29 Aug 2013 18:29:33 +0000 (18:29 +0000)
* passes.c (register_pass): Add overload.
* tree-pass.h (register_pass): Forward declare it.  Add comment.

From-SVN: r202081

gcc/ChangeLog
gcc/passes.c
gcc/tree-pass.h

index 2c92fd0e3b1d87a82f138b33325b39fa543dc994..c5ffeadd8f83a05af6321a588b17a36e4efc8052 100644 (file)
@@ -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.
index bffff412c1748163f02e1b52978282ba7da82be6..5b4975267ebb632f2493a896c3529cb04f2b1264 100644 (file)
@@ -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
index 787a49b7c41fbaeb27e9547466733d9ca831a09b..a6d8a8311a66290aa2e7f8e4f34bbaff8b82ba72 100644 (file)
@@ -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