changed codegen interface
[libfirm] / ir / be / ia32 / bearch_ia32_t.h
1 #ifndef _BEARCH_IA32_T_H_
2 #define _BEARCH_IA32_T_H_
3
4 #include "debug.h"
5 #include "bearch_ia32.h"
6 #include "ia32_nodes_attr.h"
7 #include "../be.h"
8
9 /* some typedefs */
10
11 typedef struct _ia32_code_gen_t {
12         const arch_code_generator_if_t *impl;          /**< implementation */
13         ir_graph                       *irg;           /**< current irg */
14         FILE                           *out;           /**< output file */
15         const arch_env_t               *arch_env;      /**< the arch env */
16         set                            *reg_set;       /**< set to memorize registers for non-ia32 nodes (e.g. phi nodes) */
17         firm_dbg_module_t              *mod;           /**< debugging module */
18         int                             emit_decls;    /**< flag indicating if decls were already emitted */
19         pmap                           *types;         /**< A map of modes to primitive types */
20         pmap                           *tv_ent;        /**< A map of entities that store tarvals */
21         const be_irg_t                 *birg;          /**< The be-irg (contains additional information about the irg) */
22 } ia32_code_gen_t;
23
24 typedef struct _ia32_isa_t {
25         const arch_isa_if_t   *impl;
26         const arch_register_t *sp;            /** The stack pointer register. */
27         const arch_register_t *bp;            /** The base pointer register. */
28         const int              stack_dir;     /** -1 for decreasing, 1 for increasing. */
29         int                    num_codegens;
30 } ia32_isa_t;
31
32 typedef struct _ia32_irn_ops_t {
33         const arch_irn_ops_if_t *impl;
34         ia32_code_gen_t         *cg;
35 } ia32_irn_ops_t;
36
37 /* this is a struct to minimize the number of parameters
38    for transformation walker */
39 typedef struct _ia32_transform_env_t {
40         const arch_env_t  *arch_env;   /**< The arch_env */
41         firm_dbg_module_t *mod;        /**< The firm debugger */
42         dbg_info          *dbg;        /**< The node debug info */
43         ir_graph          *irg;        /**< The irg, the node should be created in */
44         ir_node           *block;      /**< The block, the node should belong to */
45         ir_node           *irn;        /**< The irn, to be transformed */
46         ir_mode           *mode;       /**< The mode of the irn */
47         ia32_code_gen_t   *cg;         /**< The code generator */
48 } ia32_transform_env_t;
49
50 /**
51  * Creates the unique per irg GP NoReg node.
52  */
53 ir_node *ia32_new_NoReg_gp(ia32_code_gen_t *cg);
54
55 /**
56  * Creates the unique per irg FP NoReg node.
57  */
58 ir_node *ia32_new_NoReg_fp(ia32_code_gen_t *cg);
59
60 #endif /* _BEARCH_IA32_T_H_ */