cleanup: Remove unnecessary #include "beirg.h".
[libfirm] / ir / be / beinsn_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       A data structure to treat nodes and node-proj collections uniformly.
23  * @author      Sebastian Hack
24  */
25 #ifndef FIRM_BE_BEINSN_T_H
26 #define FIRM_BE_BEINSN_T_H
27
28 #include "firm_types.h"
29 #include "bitset.h"
30 #include "obst.h"
31
32 #include "bearch.h"
33 #include "bechordal.h"
34
35 typedef struct be_operand_t  be_operand_t;
36 typedef struct be_insn_t     be_insn_t;
37
38 struct be_operand_t {
39         ir_node *irn;                   /**< Firm node of the insn this operand belongs to */
40         ir_node *carrier;               /**< node representing the operand value (Proj or the node itself for defs, the used value for uses) */
41         be_operand_t *partner;          /**< used in bechordal later... (TODO what does it do?) */
42         const bitset_t *regs;           /**< admissible register bitset */
43         int pos;                        /**< pos of the operand (0 to n are inputs, -1 to -n are outputs) */
44         const arch_register_req_t *req; /**< register constraints for the carrier node */
45         unsigned has_constraints : 1;   /**< the carrier node has register constraints (the constraint type is limited) */
46 };
47
48 struct be_insn_t {
49         be_operand_t *ops;             /**< the values used and defined by the insn */
50         int n_ops;                     /**< length of the ops array */
51         int use_start;                 /**< entries [0-use_start) in ops are defs,
52                                             [use_start-n_ops) uses */
53         ir_node *irn;                  /**< ir_node of the instruction */
54         unsigned has_constraints : 1;  /**< in_constraints or out_constraints true */
55 };
56
57 /**
58  * Create a be_insn_t for an IR node.
59  *
60  * @param env      the insn construction environment
61  * @param irn      the irn for which the be_insn should be build
62  *
63  * @return the be_insn for the IR node
64  */
65 be_insn_t *be_scan_insn(be_chordal_env_t const *env, ir_node *irn);
66
67 #endif /* FIRM_BE_BEINSN_T_H */