}
}
+/* This pass gets called before any passes that the client plug-in
+ registers. It's here for any administrative details that need to
+ take place before the instrumentation passes can execute. */
+static unsigned int
+execute_pass_init ()
+{
+ return 0;
+}
+
+static struct opt_pass pass_init = {
+ .type = GIMPLE_PASS,
+ .name = "interaspect-init",
+ .gate = NULL,
+ .execute = execute_pass_init,
+ .sub = NULL,
+ .next = NULL,
+ .static_pass_number = 0,
+ .tv_id = 0,
+ .properties_required = 0,
+ .properties_provided = 0,
+ .properties_destroyed = 0,
+ .todo_flags_start = 0,
+ .todo_flags_finish = 0,
+};
+
+/* Register pass_init as the first InterAspect pass. */
+void
+register_pass_init ()
+{
+ struct register_pass_info pass_info;
+
+ pass_info.pass = &pass_init;
+ pass_info.reference_pass_name = "cfg";
+ pass_info.ref_pass_instance_number = 0;
+ pass_info.pos_op = PASS_POS_INSERT_BEFORE;
+
+ register_callback (aop_plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL,
+ &pass_info);
+}
+
/**
* InterAspect calls this function after all compilation is finished
* and before GCC and InterAspect data structures are destroyed. It
/* Register our cleanup function. */
register_callback (aop_plugin_name, PLUGIN_FINISH, aop_cleanup, NULL);
+ register_pass_init ();
+
/* Give the client plug-in its chance to register a pass. */
aop_main ();