X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbemain.c;h=82ed7e44a2c2ffe6172b2b176715e3c20e90579f;hb=ad8368234bf59eb46fbc0cfff5b7322a7efac964;hp=a7db57268d65850e6b29ff1d981c82b8caf375cf;hpb=26f53387e067b7233dd307dcfde3393a6eb798ca;p=libfirm diff --git a/ir/be/bemain.c b/ir/be/bemain.c index a7db57268..82ed7e44a 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -43,8 +43,11 @@ #include "beasm_dump_globals.h" #include "beasm_asm_gnu.h" +#include "firm2arch.h" + #undef DUMP_BEGIN #undef DUMP_PREPARED +#define DUMP_TRANSFORM #define DUMP_SCHED #define DUMP_SPILL #undef DUMP_ALLOCATED @@ -137,13 +140,16 @@ static void be_main_loop(void) be_init_env(&env); isa = arch_env_get_isa(env.arch_env); + /* create required irop's */ + create_bearch_asm_opcodes(); + /* For all graphs */ for(i = 0, n = get_irp_n_irgs(); i < n; ++i) { int j, m; ir_graph *irg = get_irp_irg(i); be_main_session_env_t session; - DBG((env.dbg, LEVEL_1, "====> IRG: %F\n", irg)); + DBG((env.dbg, LEVEL_2, "====> IRG: %F\n", irg)); #ifdef DUMP_BEGIN dump_ir_block_graph(irg, "-begin"); #endif @@ -153,6 +159,15 @@ static void be_main_loop(void) /* Compute some analyses and prepare the graph for backend use. */ prepare_graph(&session); + + transform_firm(irg); + +#ifdef DUMP_TRANSFORM + dump_ir_block_graph(irg, "-transformed"); +#endif + + +#if 0 #ifdef DUMP_PREPARED dump_dominator_information(true); dump_ir_block_graph(irg, "-prepared"); @@ -229,23 +244,17 @@ static void be_main_loop(void) dump_ir_block_graph_sched(session.irg, "-end"); #endif copystat_dump(irg); +#endif /* if 0 */ } } void be_main(int argc, const char *argv[]) { - assembler_t *gnu_assembler; - FILE *asm_output_file; + FILE *asm_output_file; - be_main_loop(); + be_main_loop(); -#if 0 - gnu_assembler = gnuasm_create_assembler(); - asm_output_file = fopen("asm_output.asm", "w"); - - asm_dump_globals(gnu_assembler); - gnuasm_dump(gnu_assembler, asm_output_file); - gnuasm_delete_assembler(gnu_assembler); - fclose(asm_output_file); -#endif + asm_output_file = fopen(argv[0], "w"); + firmbe_gen_code(asm_output_file); + fclose(asm_output_file); }