8b6998079926ca94d6def8aac4981cc378c5ba72
[libfirm] / ir / be / TEMPLATE / bearch_TEMPLATE_t.h
1 #ifndef _BEARCH_TEMPLATE_T_H_
2 #define _BEARCH_TEMPLATE_T_H_
3
4 #include "debug.h"
5 #include "bearch_TEMPLATE.h"
6 #include "TEMPLATE_nodes_attr.h"
7 #include "../be.h"
8 #include "set.h"
9
10 typedef struct _TEMPLATE_isa_t TEMPLATE_isa_t;
11
12 typedef struct _TEMPLATE_code_gen_t {
13         const arch_code_generator_if_t *impl;           /**< implementation */
14         ir_graph                       *irg;            /**< current irg */
15         const arch_env_t               *arch_env;       /**< the arch env */
16         set                            *reg_set;        /**< set to memorize registers for FIRM nodes (e.g. phi) */
17         int                             emit_decls;     /**< flag indicating if decls were already emitted */
18         TEMPLATE_isa_t                 *isa;            /**< the isa instance */
19         const be_irg_t                 *birg;           /**< The be-irg (contains additional information about the irg) */
20         DEBUG_ONLY(firm_dbg_module_t   *mod;)           /**< debugging module */
21 } TEMPLATE_code_gen_t;
22
23 struct _TEMPLATE_isa_t {
24         const arch_isa_if_t   *impl;
25         const arch_register_t *sp;            /**< The stack pointer register. */
26         const arch_register_t *bp;            /**< The base pointer register. */
27         const int              stack_dir;     /**< -1 for decreasing, 1 for increasing. */
28         int                    num_codegens;
29         FILE                  *out;           /**< output file */
30 };
31
32
33 typedef struct _TEMPLATE_irn_ops_t {
34         const arch_irn_ops_if_t *impl;
35         TEMPLATE_code_gen_t     *cg;
36 } TEMPLATE_irn_ops_t;
37
38
39 /* this is a struct to minimize the number of parameters
40    for transformation walker */
41 typedef struct _TEMPLATE_transform_env_t {
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         DEBUG_ONLY(firm_dbg_module_t *mod;)      /**< The firm debugger */
48 } TEMPLATE_transform_env_t;
49
50
51 #endif /* _BEARCH_TEMPLATE_T_H_ */