Added irn_handler field to arch_isa_t
[libfirm] / ir / be / firm2arch.c
1 /**
2  * Dumps Firm into CPU specific assembler format (the concrete
3  * implementations can be found in the <arch> subdirectories)
4  * @author Christian Wuerdig
5  * @date 18.10.2005
6  * @version $Id$
7  */
8
9 #include "pseudo_irg.h"
10 #include "irgwalk.h"
11 #include "irprog.h"
12 #include "debug.h"
13
14 #include "firm2arch.h"
15
16 /**
17  * Transforms all irgs into assembler irgs.
18  * Calls the interface function transform_node() which
19  * needs to be implemented for each architecture.
20  */
21 void transform_firm(ir_graph *irg) {
22   firm_dbg_module_t *dbg = firm_dbg_register("be.transform");
23   if (! is_pseudo_ir_graph(irg))
24     irg_walk_blkwise_graph(irg, NULL, transform_node, dbg);
25 }
26
27 /**
28  * Finishes the firm transformation. This function is called
29  * after register allocation and scheduling to build everything
30  * which can only be build after those phases e.g. function prolog
31  * and epilog.
32  * Calls the interface function finish_node_transformation which needs
33  * to be implemented for each architecture.
34  */
35 void finish_transform(ir_graph *irg) {
36   if (! is_pseudo_ir_graph(irg)) {
37  //   irg_walk_blkwise_graph(irg, NULL, finish_node_transformation, NULL);
38   }
39 }
40
41 /**
42  * Generates the architecture specific assembler code.
43  * Calls the interface functions firmbe_gen_decls() (dumps all global
44  * decls) and firmbe_gen_routine() (generates code for all routines) which
45  * need to be implemented for each architecture.
46  */
47 void firmbe_gen_code(FILE *out) {
48   int i;
49
50   firmbe_gen_decls(out);
51   for (i = 0; i < get_irp_n_irgs(); ++i) {
52     ir_graph *irg = get_irp_irg(i);
53
54 //    if (! is_pseudo_ir_graph(irg))
55  //     firmbe_gen_routine(out, irg);
56   }
57 }