1 /* Plugin that prints message if it inserted (and invoked) more than once. */
3 #include "gcc-plugin.h"
12 int plugin_is_GPL_compatible;
14 static bool one_pass_gate (void)
19 static unsigned int one_pass_exec (void)
21 static int counter = 0;
24 printf ("Executed more than once \n");
30 struct gimple_opt_pass one_pass =
35 one_pass_gate, /* gate */
36 one_pass_exec, /* execute */
39 0, /* static_pass_number */
41 PROP_gimple_any, /* properties_required */
42 0, /* properties_provided */
43 0, /* properties_destroyed */
44 0, /* todo_flags_start */
45 TODO_dump_func /* todo_flags_finish */
50 int plugin_init (struct plugin_name_args *plugin_info,
51 struct plugin_gcc_version *version)
55 p.pass = &one_pass.pass;
56 p.reference_pass_name = "useless";
57 p.ref_pass_instance_number = 1;
58 p.pos_op = PASS_POS_INSERT_AFTER;
60 register_callback ("one_pass", PLUGIN_PASS_MANAGER_SETUP, NULL, &p);