unified main comments
[libfirm] / ir / be / mips / bearch_mips_t.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 #ifndef _BEARCH_mips_T_H_
21 #define _BEARCH_mips_T_H_
22
23 #include "debug.h"
24 #include "irgopt.h"
25 #include "bearch_mips.h"
26 #include "mips_nodes_attr.h"
27 #include "../be.h"
28 #include "set.h"
29
30 typedef struct _mips_isa_t mips_isa_t;
31
32 struct _mips_code_gen_t {
33         const arch_code_generator_if_t *impl;           /**< implementation */
34         ir_graph                       *irg;            /**< current irg */
35         const arch_env_t               *arch_env;       /**< the arch env */
36         set                            *reg_set;        /**< set to memorize registers for FIRM nodes (e.g. phi) */
37         int                             emit_decls;     /**< flag indicating if decls were already emitted */
38         mips_isa_t                     *isa;            /**< the isa instance */
39         const be_irg_t                 *birg;           /**< The be-irg (contains additional information about the irg) */
40         ir_node                        **bl_list;               /**< The block schedule list. */
41         survive_dce_t                              *bl_list_sdce;       /**< survive dce environment for the block schedule list */
42         DEBUG_ONLY(firm_dbg_module_t   *mod;)           /**< debugging module */
43 };
44
45 struct _mips_isa_t {
46         const arch_isa_if_t   *impl;
47         const arch_register_t *sp;            /**< The stack pointer register. */
48         const arch_register_t *fp;            /**< The base pointer register. */
49         const int              stack_dir;     /**< -1 for decreasing, 1 for increasing. */
50         int                    num_codegens;
51   FILE                  *out;           /**< output file */
52 };
53
54 typedef struct _mips_irn_ops_t {
55         const arch_irn_ops_if_t *impl;
56         mips_code_gen_t     *cg;
57 } mips_irn_ops_t;
58
59
60 /* this is a struct to minimize the number of parameters
61    for transformation walker */
62 typedef struct _mips_transform_env_t {
63         dbg_info          *dbg;      /**< The node debug info */
64         ir_graph          *irg;      /**< The irg, the node should be created in */
65         ir_node           *block;    /**< The block, the node should belong to */
66         ir_node           *irn;      /**< The irn, to be transformed */
67         ir_mode           *mode;     /**< The mode of the irn */
68         mips_code_gen_t   *cg;       /**< The code generator */
69         DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */
70 } mips_transform_env_t;
71
72 ir_node *mips_new_NoReg(mips_code_gen_t *cg);
73
74 #endif /* _BEARCH_mips_T_H_ */