f5995a8e14addde6ee64af9f226ea624b3e3d077
[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
8 /**
9  * Creates the unique per irg GP NoReg node.
10  */
11 ir_node *ia32_new_NoReg_gp(ia32_code_gen_t *cg);
12
13 /**
14  * Creates the unique per irg FP NoReg node.
15  */
16 ir_node *ia32_new_NoReg_fp(ia32_code_gen_t *cg);
17
18 /* some typedefs */
19
20 typedef struct _ia32_code_gen_t {
21         const arch_code_generator_if_t *impl;          /**< implementation */
22         ir_graph                       *irg;           /**< current irg */
23         FILE                           *out;           /**< output file */
24         const arch_env_t               *arch_env;      /**< the arch env */
25         set                            *reg_set;       /**< set to memorize registers for non-ia32 nodes (e.g. phi nodes) */
26         firm_dbg_module_t              *mod;           /**< debugging module */
27         int                             emit_decls;    /**< flag indicating if decls were already emitted */
28         int                             has_alloca;    /**< indicates whether the irg contains an alloca or not */
29         const ia32_register_req_t     **reg_param_req; /**< hold the requirements for the reg param nodes */
30         pmap                           *types;         /**< A map of modes to primitive types */
31         pmap                           *tv_ent;        /**< A map of entities that store tarvals */
32         ir_node                        *noreg_gp;      /**< Holds the unique per irg GP NoReg node */
33         ir_node                        *noreg_fp;      /**< Holds the unique per irg FP NoReg node */
34 } ia32_code_gen_t;
35
36 typedef struct _ia32_isa_t {
37         const arch_isa_if_t   *impl;
38         const arch_register_t *sp;            /** The stack pointer register. */
39         const arch_register_t *bp;            /** The base pointer register. */
40         const int              stack_dir;     /** -1 for decreasing, 1 for increasing. */
41         int                    num_codegens;
42         set                   *reg_projnum_map;
43 } ia32_isa_t;
44
45 typedef struct _ia32_irn_ops_t {
46         const arch_irn_ops_if_t *impl;
47         ia32_code_gen_t         *cg;
48 } ia32_irn_ops_t;
49
50 /* this is a struct to minimize the number of parameters
51    for transformation walker */
52 typedef struct _ia32_transform_env_t {
53         const arch_env_t  *arch_env;   /**< The arch_env */
54         firm_dbg_module_t *mod;        /**< The firm debugger */
55         dbg_info          *dbg;        /**< The node debug info */
56         ir_graph          *irg;        /**< The irg, the node should be created in */
57         ir_node           *block;      /**< The block, the node should belong to */
58         ir_node           *irn;        /**< The irn, to be transformed */
59         ir_mode           *mode;       /**< The mode of the irn */
60         ia32_code_gen_t   *cg;         /**< The code generator */
61 } ia32_transform_env_t;
62
63 #endif /* _BEARCH_IA32_T_H_ */