+ /* Register the irn handler of the architecture */
+ if (arch_isa_get_irn_handler(env->arch_env->isa))
+ arch_env_add_irn_handler(env->arch_env, arch_isa_get_irn_handler(env->arch_env->isa));
+
+ /*
+ * Register the node handler of the back end infrastructure.
+ * This irn handler takes care of the platform independent
+ * spill, reload and perm nodes.
+ */
+ env->node_factory = obstack_alloc(&env->obst, sizeof(*env->node_factory));
+ be_node_factory_init(env->node_factory, env->arch_env->isa);
+ arch_env_add_irn_handler(env->arch_env, be_node_get_irn_handler(env->node_factory));
+
+ return env;
+}
+
+static void be_done_env(be_main_env_t *env)
+{
+ env->arch_env->isa->impl->done(env->arch_env->isa);
+ obstack_free(&env->obst, NULL);
+}
+
+static void dump(int mask, ir_graph *irg, const char *suffix,
+ void (*dumper)(ir_graph *, const char *))
+{
+ if(dump_flags & mask)
+ dumper(irg, suffix);
+}
+
+static void prepare_graph(be_main_env_t *s, ir_graph *irg)
+{
+ /* Normalize proj nodes. */
+ normalize_proj_nodes(irg);
+
+ /* Remove critical edges */
+ remove_critical_cf_edges(irg);
+
+ /* Compute the dominance information. */
+ free_dom_and_peace(irg);
+ compute_doms(irg);
+
+ /* Ensure, that the ir_edges are computed. */
+ edges_activate(irg);
+
+ /* Compute loop nesting information (for weighting copies) */
+ if (get_irg_loopinfo_state(irg) != (loopinfo_valid & loopinfo_cf_consistent))
+ construct_cf_backedges(irg);
+
+ be_check_dominance(irg);
+}
+
+static void be_main_loop(FILE *file_handle)