2 * Dumps Firm into CPU specific assembler format (the concrete
3 * implementations can be found in the <arch> subdirectories)
4 * @author Christian Wuerdig
9 #include <libfirm/firm.h>
10 #include <libfirm/pseudo_irg.h>
13 #include "firm2arch.h"
16 * Transforms all irgs into assembler irgs.
17 * Calls the interface function transform_node() which
18 * needs to be implemented for each architecture.
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);
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
31 * Calls the interface function finish_node_transformation which needs
32 * to be implemented for each architecture.
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);
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.
46 void firmbe_gen_code(FILE *out) {
49 // firmbe_gen_decls(out);
50 for (i = 0; i < get_irp_n_irgs(); ++i) {
51 ir_graph *irg = get_irp_irg(i);
53 // if (! is_pseudo_ir_graph(irg))
54 // firmbe_gen_routine(out, irg);