__visible int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
{
	int i;
	const char * const plugin_name = plugin_info->base_name;
	const int argc = plugin_info->argc;
	const struct plugin_argument * const argv = plugin_info->argv;

	PASS_INFO(cyc_complexity, "ssa", 1, PASS_POS_INSERT_AFTER);

	if (!plugin_default_version_check(version, &gcc_version)) {
		error_gcc_version(version);
		return 1;
	}

	for (i = 0; i < argc; ++i) {
		if (!strcmp(argv[i].key, "log_file")) {
			has_log_file = true;
			continue;
		}

		error(G_("unknown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
	}

	register_callback(plugin_name, PLUGIN_START_UNIT,
				&cyc_complexity_start_unit, NULL);
	register_callback (plugin_name, PLUGIN_FINISH_UNIT,
				&cyc_complexity_finish_unit, NULL);
	register_callback(plugin_name, PLUGIN_INFO, NULL,
				&cyc_complexity_plugin_info);
	register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
				&cyc_complexity_pass_info);

	return 0;
}
int
plugin_init (struct plugin_name_args *plugin_info,
	     struct plugin_gcc_version *version)
{
  struct register_pass_info pass_info;
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  struct plugin_argument *argv = plugin_info->argv;

  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  for (int i = 0; i < argc; i++)
    {
      if (0 == strcmp (argv[i].key, "color"))
	force_show_locus_color = true;
    }

  pass_info.pass = make_pass_test_show_locus (g);
  pass_info.reference_pass_name = "ssa";
  pass_info.ref_pass_instance_number = 1;
  pass_info.pos_op = PASS_POS_INSERT_AFTER;
  register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
		     &pass_info);

  return 0;
}
int
plugin_init (struct plugin_name_args *plugin_info,
	     struct plugin_gcc_version *version)
{
  struct register_pass_info pass_info;
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  struct plugin_argument *argv = plugin_info->argv;

  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  /* For now, tell the dc to expect ranges and thus to colorize the source
     lines, not just the carets/underlines.  This will be redundant
     once the C frontend generates ranges.  */
  global_dc->colorize_source_p = true;

  for (int i = 0; i < argc; i++)
    {
      if (0 == strcmp (argv[i].key, "color"))
	force_show_locus_color = true;
    }

  pass_info.pass = make_pass_test_show_locus (g);
  pass_info.reference_pass_name = "ssa";
  pass_info.ref_pass_instance_number = 1;
  pass_info.pos_op = PASS_POS_INSERT_AFTER;
  register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
		     &pass_info);

  return 0;
}
int
plugin_init (struct plugin_name_args *plugin_info,
	     struct plugin_gcc_version *version)
{
  struct register_pass_info pass_info;
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  struct plugin_argument *argv = plugin_info->argv;

  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  diagnostic_starter (global_dc) = test_diagnostic_starter;
  global_dc->start_span = test_diagnostic_start_span_fn;
  global_dc->begin_group_cb = test_begin_group_cb;
  global_dc->end_group_cb = test_end_group_cb;

  pass_info.pass = new pass_test_groups (g);
  pass_info.reference_pass_name = "*warn_function_noreturn";
  pass_info.ref_pass_instance_number = 1;
  pass_info.pos_op = PASS_POS_INSERT_AFTER;
  register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
		     &pass_info);

  return 0;
}
Exemplo n.º 5
0
__visible int plugin_init(struct plugin_name_args *plugin_info,
			  struct plugin_gcc_version *version)
{
	const char * const plugin_name = plugin_info->base_name;
	const int argc = plugin_info->argc;
	const struct plugin_argument *argv = plugin_info->argv;
	int tso = 0;
	int i;

	if (!plugin_default_version_check(version, &gcc_version)) {
		error(G_("incompatible gcc/plugin versions"));
		return 1;
	}

	for (i = 0; i < argc; ++i) {
		if (!strcmp(argv[i].key, "disable"))
			return 0;

		/* all remaining options require a value */
		if (!argv[i].value) {
			error(G_("no value supplied for option '-fplugin-arg-%s-%s'"),
			      plugin_name, argv[i].key);
			return 1;
		}

		if (!strcmp(argv[i].key, "tso")) {
			tso = atoi(argv[i].value);
			continue;
		}

		if (!strcmp(argv[i].key, "offset")) {
			canary_offset = atoi(argv[i].value);
			continue;
		}
		error(G_("unknown option '-fplugin-arg-%s-%s'"),
		      plugin_name, argv[i].key);
		return 1;
	}

	/* create the mask that produces the base of the stack */
	sp_mask = ~((1U << (12 + tso)) - 1);

	PASS_INFO(arm_pertask_ssp_rtl, "expand", 1, PASS_POS_INSERT_AFTER);

	register_callback(plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP,
			  NULL, &arm_pertask_ssp_rtl_pass_info);

#if BUILDING_GCC_VERSION >= 9000
	register_callback(plugin_info->base_name, PLUGIN_START_UNIT,
			  arm_pertask_ssp_start_unit, NULL);
#endif

	return 0;
}
Exemplo n.º 6
0
/* Initialize the global tree nodes that correspond to mf-runtime.h
   declarations.  */
int
plugin_init (struct plugin_name_args *pinfo,
             struct plugin_gcc_version *version)
{
    struct register_pass_info pass_info1;
    struct register_pass_info pass_info2;
    const char *plugin_name = "LBC";

    struct plugin_info info = {"1.0", "Use -fplugin=path/to/lbc.so to use the lbc plugin"};

    DEBUGLOG("LBC Plugin: Initializing plugin version %s \n", info.version);

    // Check for build time versus run time gcc version
    if (!plugin_default_version_check (version, &gcc_version))
        return 1;

    // Start plugin related work here.
    register_callback (plugin_name, PLUGIN_START_UNIT, execute_lbc_init, NULL);
    register_callback (plugin_name, PLUGIN_FINISH_UNIT, execute_lbc_finish, NULL);

    // TODO for some reason the following call is giving a segfault in GCC code
    //register_callback (plugin_name, PLUGIN_INFO, NULL, &info);

    DEBUGLOG("LBC Plugin: Building pass1\n");
    pass_info1.pass = &pass_lbc_1.pass;
    pass_info1.reference_pass_name = "omplower";
    pass_info1.ref_pass_instance_number = 1;
    pass_info1.pos_op = PASS_POS_INSERT_BEFORE;

    DEBUGLOG("LBC Plugin: Registering pass1\n");
    register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info1);

    DEBUGLOG("LBC Plugin: Building pass2\n");
    pass_info2.pass = &pass_lbc_2.pass;
    //pass_info2.reference_pass_name = "ssa";
    pass_info2.reference_pass_name = "optimized";
    pass_info2.ref_pass_instance_number = 1;
    pass_info2.pos_op = PASS_POS_INSERT_BEFORE;

    DEBUGLOG("LBC Plugin: Registering pass2\n");
    register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info2);
    return 0;
}
int
plugin_init (struct plugin_name_args *plugin_info,
	     struct plugin_gcc_version *version)
{
  struct register_pass_info pass_info;
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  struct plugin_argument *argv = plugin_info->argv;

  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  pass_info.pass = new pass_test_string_literals (g);
  pass_info.reference_pass_name = "ssa";
  pass_info.ref_pass_instance_number = 1;
  pass_info.pos_op = PASS_POS_INSERT_AFTER;
  register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
		     &pass_info);

  return 0;
}
int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
{
	const char * const plugin_name = plugin_info->base_name;
	bool enable = true;
	struct register_pass_info dump_call_graph_plugin_pass_info;

	dump_call_graph_plugin_pass_info.pass			= make_dump_call_graph_plugin_pass();
	dump_call_graph_plugin_pass_info.reference_pass_name	= "increase_alignment";
	dump_call_graph_plugin_pass_info.ref_pass_instance_number	= 1;
	dump_call_graph_plugin_pass_info.pos_op			= PASS_POS_INSERT_BEFORE;

	if (!plugin_default_version_check(version, &gcc_version)) {
		error(G_("incompatible gcc/plugin versions"));
		return 1;
	}

	register_callback(plugin_name, PLUGIN_INFO, NULL, &dump_call_graph_plugin_info);
	if (enable)
		register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &dump_call_graph_plugin_pass_info);

	return 0;
}
Exemplo n.º 9
0
int plugin_init
(
    struct plugin_name_args* plugin_info,
    struct plugin_gcc_version* version
)
{
    TRACE();

    /* todo: disablable thru argument passing */
    if (!plugin_default_version_check(version, &gcc_version))
    {
        printf("compiler version does not match\n");
        return 1;
    }

    init_datastructs();

    register_callbacks();
    register_pragmas();
    register_mein_pass();

    return 0;
}
Exemplo n.º 10
0
int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
{
	const char * const plugin_name = plugin_info->base_name;
	const int argc = plugin_info->argc;
	const struct plugin_argument * const argv = plugin_info->argv;
	int i;

	if (!plugin_default_version_check(version, &gcc_version)) {
		error(G_("incompatible gcc/plugin versions"));
		return 1;
	}

	register_callback(plugin_name, PLUGIN_INFO, NULL, &checker_plugin_info);

	for (i = 0; i < argc; ++i)
		error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);

	if (TARGET_64BIT == 0)
		return 0;

	register_callback (plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);

	return 0;
}
Exemplo n.º 11
0
/* The initialization routine exposed to and called by GCC. The spec of this
   function is defined in gcc/gcc-plugin.h.

   Note that this function needs to be named exactly "plugin_init".  */
int
plugin_init (struct plugin_name_args *plugin_info,
	      struct plugin_gcc_version *version)
{
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  int i = 0;
  struct plugin_argument *argv = plugin_info->argv;
  if (!plugin_default_version_check (version, &gcc_version))
    return 1;
  /* Process the plugin arguments. This plugin takes the following arguments:
     count-ggc-start count-ggc-end count-ggc-mark */
  for (i = 0; i < argc; ++i)
    {
      if (!strcmp (argv[i].key, "count-ggc-start"))
	{
	  if (argv[i].value)
	    warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-start=%s'"
			    " ignored (superfluous '=%s')"),
		     plugin_name, argv[i].value, argv[i].value);
	  else
	    register_callback ("ggcplug",
			       PLUGIN_GGC_START,
			       increment_callback,
			       (void *) &our_ggc_start_counter);
	}
      else if (!strcmp (argv[i].key, "count-ggc-end"))
	{
	  if (argv[i].value)
	    warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-end=%s'"
			    " ignored (superfluous '=%s')"),
		     plugin_name, argv[i].value, argv[i].value);
	  else
	    register_callback ("ggcplug",
			       PLUGIN_GGC_END,
			       increment_callback,
			       (void *) &our_ggc_end_counter);
	}
      else if (!strcmp (argv[i].key, "count-ggc-mark"))
	{
	  if (argv[i].value)
	    warning (0, G_ ("option '-fplugin-arg-%s-count-ggc-mark=%s'"
			    " ignored (superfluous '=%s')"),
		     plugin_name, argv[i].value, argv[i].value);
	  else
	    register_callback ("ggcplug",
			       PLUGIN_GGC_MARKING,
			       increment_callback,
			       (void *) &our_ggc_marking_counter);
	}
      else if (!strcmp (argv[i].key, "test-extra-root"))
	{
	  if (argv[i].value)
	    warning (0, G_ ("option '-fplugin-arg-%s-test-extra-root=%s'"
			    " ignored (superfluous '=%s')"),
		     plugin_name, argv[i].value, argv[i].value);
	  else
	    register_callback ("ggcplug",
			       PLUGIN_REGISTER_GGC_ROOTS,
			       NULL,
			       (void *) our_xtratab);
	}
    }
  /* plugin initialization succeeded */
  return 0;
 }
Exemplo n.º 12
0
int
plugin_init (struct plugin_name_args *plugin_info,
             struct plugin_gcc_version *version)
{
    LOG("plugin_init started");

    if (!plugin_default_version_check (version, &gcc_version)) {
        return 1;
    }

#if PY_MAJOR_VERSION >= 3
    /*
      Python 3 added internal buffering to sys.stdout and sys.stderr, but this
      leads to unpredictable interleavings of messages from gcc, such as from calling
      gcc.warning() vs those from python scripts, such as from print() and
      sys.stdout.write()

      Suppress the buffering, to better support mixed gcc/python output:
    */
    Py_UnbufferedStdioFlag = 1;
#endif

    PyImport_AppendInittab("gcc", PyInit_gcc);

    LOG("calling Py_Initialize...");

    Py_Initialize();

    LOG("Py_Initialize finished");

    gcc_python_globals.module = PyImport_ImportModule("gcc");

    PyEval_InitThreads();
  
    if (!gcc_python_init_gcc_module(plugin_info)) {
        return 1;
    }

    if (!setup_sys(plugin_info)) {
        return 1;
    }

    /* Init other modules */
    gcc_python_wrapper_init();

    /* FIXME: properly integrate them within the module hierarchy */

    gcc_python_version_init(version);

    autogenerated_callgraph_init_types();  /* FIXME: error checking! */
    autogenerated_cfg_init_types();  /* FIXME: error checking! */
    autogenerated_function_init_types();  /* FIXME: error checking! */
    autogenerated_gimple_init_types();  /* FIXME: error checking! */
    autogenerated_location_init_types();  /* FIXME: error checking! */
    autogenerated_option_init_types();  /* FIXME: error checking! */
    autogenerated_parameter_init_types();  /* FIXME: error checking! */
    autogenerated_pass_init_types();  /* FIXME: error checking! */
    autogenerated_pretty_printer_init_types();  /* FIXME: error checking! */
    autogenerated_rtl_init_types(); /* FIXME: error checking! */
    autogenerated_tree_init_types(); /* FIXME: error checking! */
    autogenerated_variable_init_types(); /* FIXME: error checking! */



    autogenerated_callgraph_add_types(gcc_python_globals.module);
    autogenerated_cfg_add_types(gcc_python_globals.module);
    autogenerated_function_add_types(gcc_python_globals.module);
    autogenerated_gimple_add_types(gcc_python_globals.module);
    autogenerated_location_add_types(gcc_python_globals.module);
    autogenerated_option_add_types(gcc_python_globals.module);
    autogenerated_parameter_add_types(gcc_python_globals.module);
    autogenerated_pass_add_types(gcc_python_globals.module);
    autogenerated_pretty_printer_add_types(gcc_python_globals.module);
    autogenerated_rtl_add_types(gcc_python_globals.module);
    autogenerated_tree_add_types(gcc_python_globals.module);
    autogenerated_variable_add_types(gcc_python_globals.module);


    /* Register at-exit finalization for the plugin: */
    register_callback(plugin_info->base_name, PLUGIN_FINISH,
                      on_plugin_finish, NULL);

    gcc_python_run_any_command();
    gcc_python_run_any_script();

    //printf("%s:%i:got here\n", __FILE__, __LINE__);

#if GCC_PYTHON_TRACE_ALL_EVENTS
#define DEFEVENT(NAME) \
    if (NAME != PLUGIN_PASS_MANAGER_SETUP &&         \
        NAME != PLUGIN_INFO &&                       \
	NAME != PLUGIN_REGISTER_GGC_ROOTS &&         \
	NAME != PLUGIN_REGISTER_GGC_CACHES) {        \
    register_callback(plugin_info->base_name, NAME,  \
		      trace_callback_for_##NAME, NULL); \
    }
# include "plugin.def"
# undef DEFEVENT
#endif /* GCC_PYTHON_TRACE_ALL_EVENTS */

    LOG("init_plugin finished");

    return 0;
}
Exemplo n.º 13
0
int
plugin_init (struct plugin_name_args *plugin_info,
             struct plugin_gcc_version *version)
{
  struct register_pass_info pass_info;
  const char *plugin_name = plugin_info->base_name;
  int argc = plugin_info->argc;
  struct plugin_argument *argv = plugin_info->argv;
  bool enabled = true;
  int i;

  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  /* Self-assign detection should happen after SSA is constructed.  */
  pass_info.pass = make_pass_warn_self_assign (g);
  pass_info.reference_pass_name = "ssa";
  pass_info.ref_pass_instance_number = 1;
  pass_info.pos_op = PASS_POS_INSERT_AFTER;

  /* Process the plugin arguments. This plugin takes the following arguments:
     check-operator-eq, no-check-operator-eq, enable, and disable.
     By default, the analysis is enabled with 'operator=' checked.  */
  for (i = 0; i < argc; ++i)
    {
      if (!strcmp (argv[i].key, "check-operator-eq"))
        {
          if (argv[i].value)
            warning (0, G_("option '-fplugin-arg-%s-check-operator-eq=%s'"
                           " ignored (superfluous '=%s')"),
                     plugin_name, argv[i].value, argv[i].value);
          else
            check_operator_eq = true;
        }
      else if (!strcmp (argv[i].key, "no-check-operator-eq"))
        {
          if (argv[i].value)
            warning (0, G_("option '-fplugin-arg-%s-no-check-operator-eq=%s'"
                           " ignored (superfluous '=%s')"),
                     plugin_name, argv[i].value, argv[i].value);
          else
            check_operator_eq = false;
        }
      else if (!strcmp (argv[i].key, "enable"))
        {
          if (argv[i].value)
            warning (0, G_("option '-fplugin-arg-%s-enable=%s' ignored"
                           " (superfluous '=%s')"),
                     plugin_name, argv[i].value, argv[i].value);
          else
            enabled = true;
        }
      else if (!strcmp (argv[i].key, "disable"))
        {
          if (argv[i].value)
            warning (0, G_("option '-fplugin-arg-%s-disable=%s' ignored"
                           " (superfluous '=%s')"),
                     plugin_name, argv[i].value, argv[i].value);
          else
            enabled = false;
        }
      else
        warning (0, G_("plugin %qs: unrecognized argument %qs ignored"),
                 plugin_name, argv[i].key);
    }

  /* Register this new pass with GCC if the analysis is enabled.  */
  if (enabled)
    register_callback (plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
                       &pass_info);

  return 0;
}
Exemplo n.º 14
0
int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
{
	const char * const plugin_name = plugin_info->base_name;
	const int argc = plugin_info->argc;
	const struct plugin_argument * const argv = plugin_info->argv;
	int i;
	struct register_pass_info kernexec_reload_pass_info = {
		.pass				= &kernexec_reload_pass.pass,
		.reference_pass_name		= "ssa",
		.ref_pass_instance_number	= 1,
		.pos_op 			= PASS_POS_INSERT_AFTER
	};
	struct register_pass_info kernexec_fptr_pass_info = {
		.pass				= &kernexec_fptr_pass.pass,
		.reference_pass_name		= "ssa",
		.ref_pass_instance_number	= 1,
		.pos_op 			= PASS_POS_INSERT_AFTER
	};
	struct register_pass_info kernexec_retaddr_pass_info = {
		.pass				= &kernexec_retaddr_pass.pass,
		.reference_pass_name		= "pro_and_epilogue",
		.ref_pass_instance_number	= 1,
		.pos_op 			= PASS_POS_INSERT_AFTER
	};

	if (!plugin_default_version_check(version, &gcc_version)) {
		error(G_("incompatible gcc/plugin versions"));
		return 1;
	}

	register_callback(plugin_name, PLUGIN_INFO, NULL, &kernexec_plugin_info);

	if (TARGET_64BIT == 0)
		return 0;

	for (i = 0; i < argc; ++i) {
		if (!strcmp(argv[i].key, "method")) {
			if (!argv[i].value) {
				error(G_("no value supplied for option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
				continue;
			}
			if (!strcmp(argv[i].value, "bts")) {
				kernexec_instrument_fptr = kernexec_instrument_fptr_bts;
				kernexec_instrument_retaddr = kernexec_instrument_retaddr_bts;
			} else if (!strcmp(argv[i].value, "or")) {
				kernexec_instrument_fptr = kernexec_instrument_fptr_or;
				kernexec_instrument_retaddr = kernexec_instrument_retaddr_or;
				fix_register("r10", 1, 1);
			} else
				error(G_("invalid option argument '-fplugin-arg-%s-%s=%s'"), plugin_name, argv[i].key, argv[i].value);
			continue;
		}
		error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
	}
	if (!kernexec_instrument_fptr || !kernexec_instrument_retaddr)
		error(G_("no instrumentation method was selected via '-fplugin-arg-%s-method'"), plugin_name);

	if (kernexec_instrument_fptr == kernexec_instrument_fptr_or)
		register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_reload_pass_info);
	register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_fptr_pass_info);
	register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_retaddr_pass_info);

	return 0;
}
Exemplo n.º 15
0
int
plugin_init (struct plugin_name_args *plugin_info,
             struct plugin_gcc_version *version)
{
  if (!plugin_default_version_check (version, &gcc_version))
    return 1;

  int argc_index;
  outdir_name[0]=0;
  for(argc_index=0; argc_index<plugin_info->argc; ++argc_index)
  {
    if(strcmp(plugin_info->argv[argc_index].key, "outputdir")==0)
    {
       if(strlen(plugin_info->argv[argc_index].value)>1024)
         return 1;
       strcpy(outdir_name,plugin_info->argv[argc_index].value);
       break;
    }
  }

  struct register_pass_info pass_info;

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
  pass_info.pass = make_custom_pass_vrp(g);
#else
  pass_info.pass = &custom_pass_vrp.pass;
#endif
  pass_info.reference_pass_name = "vrp";

  /* Do it for every instance if it is 0. */
  pass_info.ref_pass_instance_number = 0;

  /* This pass can go almost anywhere as long as you're in SSA form */
  pass_info.pos_op = PASS_POS_REPLACE;

  /* Register this new pass with GCC */
  register_callback (plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
                     &pass_info);
  serialize_state = -1;


#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
  pass_info.pass = make_pass_dump_GSSA(g);
#else
  pass_info.pass = &pass_dump_GSSA.pass;
#endif
  pass_info.reference_pass_name = "optimized";

  DumpGimpleInit(outdir_name);

  /* Do it for every instance if it is 0. */
  pass_info.ref_pass_instance_number = 1;

  /* This pass can go almost anywhere as long as you're in SSA form */
  pass_info.pos_op = PASS_POS_INSERT_AFTER;

  /* Register this new pass with GCC */
  register_callback (plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
                     &pass_info);
  serialize_state = -1;

  return 0;
}