X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Fircons_t.h;h=5ea921027cd7c6e3c1bfd1e0f9738b3ced7a8d6e;hb=843966a07b6f15b1adf21924d9d846bc8282df0a;hp=22c6ea3683d452f64a5c5c690c3096af175f442c;hpb=db44b33a0812306bc02d27a63290c96511bfb567;p=libfirm diff --git a/ir/ir/ircons_t.h b/ir/ir/ircons_t.h index 22c6ea368..5ea921027 100644 --- a/ir/ir/ircons_t.h +++ b/ir/ir/ircons_t.h @@ -1,42 +1,76 @@ /* - * Project: libFIRM - * File name: ir/ir/ircons_t.h - * Purpose: Various irnode constructors. Automatic construction - * of SSA representation. - * Author: Martin Trapp, Christian Schaefer - * Modified by: Michael Beck - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2003 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * 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. + * + * 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. + */ + +/** + * @file + * @brief Various irnode constructors. Automatic construction + * of SSA representation. Private Header + * @author Martin Trapp, Christian Schaefer, Michael Beck */ -#ifndef _IRCONS_T_H_ -#define _IRCONS_T_H_ +#ifndef FIRM_IR_IRCONS_T_H +#define FIRM_IR_IRCONS_T_H #include "ircons.h" -# include "irgraph_t.h" +#include "irgraph_t.h" /** - * Initializes the graph construction. - * - * @param func @see uninitialized_local_variable_func_t + * Creates a new Anchor node. */ -void init_cons(uninitialized_local_variable_func_t *func); +ir_node *new_r_Anchor(ir_graph *irg); -/* inline functions */ +/** create new block node without immediately optimizing it. + * This is an internal helper function for new_ir_graph() */ +ir_node *new_r_Block_noopt(ir_graph *irg, int arity, ir_node *in[]); -static INLINE ir_node * -_new_d_Bad(void) { - return current_ir_graph->bad; -} - -static INLINE ir_node * -_new_d_NoMem(void) { - return current_ir_graph->no_mem; -} +/** + * Allocate a frag array for a node if the current graph state is phase_building. + * + * @param irn the node for which the frag array should be allocated + * @param op the opcode of the (original) node, if does not match opcode of irn, + * nothing is done + * @param frag_store the address of the frag store in irn attributes, if this + * address contains a value != NULL, does nothing + */ +void firm_alloc_frag_arr(ir_node *irn, ir_op *op, ir_node ***frag_store); +/** + * Restarts SSA construction on the given graph with n_loc + * new values. + * + * @param irg the graph on which the SSA construction is restarted + * @param n_loc number of new variables + * + * After this function is complete, the graph is in phase_building + * again and set_value()/get_value() and mature_block() can be used + * to construct new values. + * + * @note do not use get_mem()/set_mem() they will build a new memory + * instead of modifying the old one which might be not what you expect... + */ +void ssa_cons_start(ir_graph *irg, int n_loc); -#define new_d_Bad() _new_d_Bad() -#define new_d_NoMem() _new_d_NoMem() +/** + * Finalize the (restarted) SSA construction. Matures all blocks that are + * not matured yet and reset the graph state to phase_high. + * + * @param irg the graph on which the SSA construction was restarted + */ +void ssa_cons_finish(ir_graph *irg); -#endif /* _IRCONS_T_H_ */ +#endif