+ /* Get the code generator interface. */
+ cg_if = isa->impl->get_code_generator(isa);
+
+ /* get a code generator for this graph. */
+ cg = cg_if->init(file_handle, irg, env.arch_env);
+
+ /* create the code generator and generate code. */
+ prepare_graph(&env, irg);
+ arch_code_generator_prepare_graph(cg);
+
+ edges_deactivate(irg);
+ dead_node_elimination(irg);
+ edges_activate(irg);
+
+ dump(DUMP_PREPARED, irg, "-prepared", dump_ir_block_graph);
+
+ /* Schedule the graphs. */
+ arch_code_generator_before_sched(cg);
+ list_sched(isa, irg);
+
+ dump(DUMP_SCHED, irg, "-sched", dump_ir_block_graph_sched);
+
+ /* Verify the schedule */
+ sched_verify_irg(irg);
+
+ /* Do register allocation */
+ arch_code_generator_before_ra(cg);
+ ra->allocate(&env, irg);
+
+ dump(DUMP_RA, irg, "-ra", dump_ir_block_graph_sched);
+
+ arch_code_generator_done(cg);
+ dump(DUMP_FINAL, irg, "-end", dump_ir_block_graph_sched);