X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeinsn_t.h;h=8c8c953b7907f839e67170cb65869c73df23c040;hb=2cfb4be35e6255d7cd59824e9b7a5eea39705227;hp=53fc828dea5479821320272b3d997723da5379d1;hpb=a62baf3793037f4657a37c7f298d18dfafedd1e5;p=libfirm diff --git a/ir/be/beinsn_t.h b/ir/be/beinsn_t.h index 53fc828de..8c8c953b7 100644 --- a/ir/be/beinsn_t.h +++ b/ir/be/beinsn_t.h @@ -1,52 +1,61 @@ -/** - * Instructions +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. * - * A data structure to treat nodes and node-proj collections uniformly. + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. */ -#ifndef _BEINSN_T_H -#define _BEINSN_T_H +/** + * @file + * @brief A data structure to treat nodes and node-proj collections uniformly. + * @author Sebastian Hack + */ +#ifndef FIRM_BE_BEINSN_T_H +#define FIRM_BE_BEINSN_T_H +#include "firm_types.h" #include "bitset.h" #include "bearch.h" +#include "bechordal.h" -typedef struct _be_operand_t be_operand_t; -typedef struct _be_insn_t be_insn_t; -typedef struct _be_insn_env_t be_insn_env_t; - -struct _be_operand_t { - ir_node *irn; - ir_node *carrier; - be_operand_t *partner; - bitset_t *regs; - int pos; - arch_register_req_t req; - unsigned has_constraints : 1; -}; +typedef struct be_operand_t be_operand_t; +typedef struct be_insn_t be_insn_t; -struct _be_insn_t { - be_operand_t *ops; - int n_ops; - int use_start; - ir_node *next_insn; - ir_node *irn; - unsigned in_constraints : 1; - unsigned out_constraints : 1; - unsigned has_constraints : 1; - unsigned pre_colored : 1; +struct be_operand_t { + ir_node *carrier; /**< node representing the operand value (Proj or the node itself for defs, the used value for uses) */ + be_operand_t *partner; /**< used in bechordal later... (TODO what does it do?) */ + unsigned const *regs; /**< admissible register bitset */ }; -struct _be_insn_env_t { - struct obstack *obst; - const arch_env_t *aenv; - const arch_register_class_t *cls; - bitset_t *ignore_colors; +struct be_insn_t { + be_operand_t *ops; /**< the values used and defined by the insn */ + int n_ops; /**< length of the ops array */ + int use_start; /**< entries [0-use_start) in ops are defs, + [use_start-n_ops) uses */ + ir_node *irn; /**< ir_node of the instruction */ }; -#define be_insn_n_defs(insn) ((insn)->use_start) -#define be_insn_n_uses(insn) ((insn)->n_ops - (insn)->use_start) - -be_insn_t *be_scan_insn(const be_insn_env_t *env, ir_node *irn); +/** + * Create a be_insn_t for an IR node. + * + * @param env the insn construction environment + * @param irn the irn for which the be_insn should be build + * + * @return the be_insn for the IR node + */ +be_insn_t *be_scan_insn(be_chordal_env_t *env, ir_node *irn); -#endif /* _BEINSN_T_H */ +#endif /* FIRM_BE_BEINSN_T_H */