- implemented apply phase
[libfirm] / ir / be / TEMPLATE / bearch_TEMPLATE_t.h
1 /*
2  * Copyright (C) 1995-2008 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   declarations for TEMPALTE backend -- private header
23  * @version $Id$
24  */
25 #ifndef FIRM_BE_TEMPLATE_BEARCH_TEMPLATE_T_H
26 #define FIRM_BE_TEMPLATE_BEARCH_TEMPLATE_T_H
27
28 #include "debug.h"
29 #include "bearch_TEMPLATE.h"
30 #include "TEMPLATE_nodes_attr.h"
31 #include "be.h"
32 #include "../beemitter.h"
33 #include "set.h"
34
35 typedef struct TEMPLATE_isa_t            TEMPLATE_isa_t;
36 typedef struct TEMPLATE_code_gen_t       TEMPLATE_code_gen_t;
37 typedef struct TEMPLATE_transform_env_t  TEMPLATE_transform_env_t;
38
39 struct TEMPLATE_code_gen_t {
40         const arch_code_generator_if_t *impl;           /**< implementation */
41         ir_graph                       *irg;            /**< current irg */
42         set                            *reg_set;        /**< set to memorize registers for FIRM nodes (e.g. phi) */
43         TEMPLATE_isa_t                 *isa;            /**< the isa instance */
44         const be_irg_t                 *birg;           /**< The be-irg (contains additional information about the irg) */
45         DEBUG_ONLY(firm_dbg_module_t   *mod;)           /**< debugging module */
46 };
47
48 struct TEMPLATE_isa_t {
49         arch_env_t             arch_env;      /**< must be derived from arch_isa */
50 };
51
52 /**
53  * this is a struct to minimize the number of parameters
54  * for transformation walker
55  */
56 struct TEMPLATE_transform_env_t {
57         dbg_info          *dbg;      /**< The node debug info */
58         ir_graph          *irg;      /**< The irg, the node should be created in */
59         ir_node           *block;    /**< The block, the node should belong to */
60         ir_node           *irn;      /**< The irn, to be transformed */
61         ir_mode           *mode;     /**< The mode of the irn */
62         DEBUG_ONLY(firm_dbg_module_t *mod;)      /**< The firm debugger */
63 };
64
65 #endif