added generation of missing function prototypes
[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 <libfirm/firm.h>
10 #include <libfirm/pseudo_irg.h>
11 #include "debug.h"
12
13 #include "firm2arch.h"
14
15 /**
16  * Transforms all irgs into assembler irgs.
17  * Calls the interface function transform_node() which
18  * needs to be implemented for each architecture.
19  */
20 void transform_firm(ir_graph *irg) {
21   firm_dbg_module_t *dbg = firm_dbg_register("be.transform");
22   if (! is_pseudo_ir_graph(irg))
23     irg_walk_blkwise_graph(irg, NULL, transform_node, dbg);
24 }
25
26 /**
27  * Finishes the firm transformation. This function is called
28  * after register allocation and scheduling to build everything
29  * which can only be build after those phases e.g. function prolog
30  * and epilog.
31  * Calls the interface function finish_node_transformation which needs
32  * to be implemented for each architecture.
33  */
34 void finish_transform(ir_graph *irg) {
35   if (! is_pseudo_ir_graph(irg)) {
36  //   irg_walk_blkwise_graph(irg, NULL, finish_node_transformation, NULL);
37   }
38 }
39
40 /**
41  * Generates the architecture specific assembler code.
42  * Calls the interface functions firmbe_gen_decls() (dumps all global
43  * decls) and firmbe_gen_routine() (generates code for all routines) which
44  * need to be implemented for each architecture.
45  */
46 void firmbe_gen_code(FILE *out) {
47   int i;
48
49 //  firmbe_gen_decls(out);
50   for (i = 0; i < get_irp_n_irgs(); ++i) {
51     ir_graph *irg = get_irp_irg(i);
52
53 //    if (! is_pseudo_ir_graph(irg))
54  //     firmbe_gen_routine(out, irg);
55   }
56 }