added doxygen comments, transform mips to new emit style, use gnuas gendecls
[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 /**
21  * @file
22  * @brief   datastructures and declarations for the mips backend
23  * @author  Matthias Braun, Mehdi
24  * @version $Id$
25  */
26 #ifndef FIRM_BE_MIPS_BEARCH_MIPS_T_H
27 #define FIRM_BE_MIPS_BEARCH_MIPS_T_H
28
29 #include "debug.h"
30 #include "irgopt.h"
31 #include "bearch_mips.h"
32 #include "mips_nodes_attr.h"
33 #include "../be.h"
34 #include "../beemitter.h"
35 #include "set.h"
36
37 typedef struct mips_isa_t            mips_isa_t;
38 typedef struct mips_irn_ops_t        mips_irn_ops_t;
39 typedef struct mips_transform_env_t  mips_transform_env_t;
40
41 struct mips_code_gen_t {
42         const arch_code_generator_if_t *impl;           /**< implementation */
43         ir_graph                       *irg;            /**< current irg */
44         const arch_env_t               *arch_env;       /**< the arch env */
45         set                            *reg_set;        /**< set to memorize registers for FIRM nodes (e.g. phi) */
46         int                             emit_decls;     /**< flag indicating if decls were already emitted */
47         mips_isa_t                     *isa;            /**< the isa instance */
48         const be_irg_t                 *birg;           /**< The be-irg (contains additional information about the irg) */
49         ir_node                        **bl_list;               /**< The block schedule list. */
50         survive_dce_t                              *bl_list_sdce;       /**< survive dce environment for the block schedule list */
51         DEBUG_ONLY(firm_dbg_module_t   *mod;)           /**< debugging module */
52 };
53
54 struct mips_isa_t {
55         arch_isa_t             arch_isa;    /**< must be derived from arch_isa_t */
56
57         be_emit_env_t          emit;
58 };
59
60 struct mips_irn_ops_t {
61         const arch_irn_ops_if_t *impl;
62         mips_code_gen_t         *cg;
63 };
64
65
66 /**
67  * this is a struct to minimize the number of parameters
68  * for transformation walker
69  */
70 struct mips_transform_env_t {
71         dbg_info          *dbg;      /**< The node debug info */
72         ir_graph          *irg;      /**< The irg, the node should be created in */
73         ir_node           *block;    /**< The block, the node should belong to */
74         ir_node           *irn;      /**< The irn, to be transformed */
75         ir_mode           *mode;     /**< The mode of the irn */
76         mips_code_gen_t   *cg;       /**< The code generator */
77         DEBUG_ONLY(firm_dbg_module_t *mod;) /**< The firm debugger */
78 };
79
80 ir_node *mips_new_NoReg(mips_code_gen_t *cg);
81
82 #endif