X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode.h;h=a523b262909eb0e4648b3c6a7b36a5065b9ccf2d;hb=cf3056ad5ceb8c9018c01e634fc5e85bb4bfd6fb;hp=4858cedff1995317d842b67413c5bddb144ee73e;hpb=9edb66bfe6e6f5bcecdd5a3e9c0d161079c6f92f;p=libfirm diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index 4858cedff..a523b2629 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -1,16 +1,30 @@ /* - * Project: libFIRM - * File name: ir/ir/irnode.h - * Purpose: Representation of an intermediate operation. - * Author: Martin Trapp, Christian Schaefer - * Modified by: Goetz Lindenmaier, Michael Beck - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2006 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2007 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 Representation of an intermediate operation. + * @author Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck + * @version $Id$ */ -#ifndef _FIRM_IR_IRNODE_H_ -#define _FIRM_IR_IRNODE_H_ +#ifndef FIRM_IR_IRNODE_H +#define FIRM_IR_IRNODE_H #include @@ -117,7 +131,7 @@ int add_irn_dep(ir_node *node, ir_node *dep); /** * Copy all dependencies from a node to another. - * @param tgt The node which sould be enriched. + * @param tgt The node which should be enriched. * @param src The node whose dependencies shall be copied. */ void add_irn_deps(ir_node *tgt, ir_node *src); @@ -159,6 +173,12 @@ ir_node *get_irn_inter_n(const ir_node *node, int n); /** Replace the n-th predecessor of a node with a new one. */ void set_irn_n(ir_node *node, int n, ir_node *in); +/** + * Appends a new predecessor to a node. This only works for nodes with + * variable arity! + * @returns the number of the new input + */ +int add_irn_n(ir_node *node, ir_node *in); /* Sets the mode struct of node. */ void set_irn_mode(ir_node *node, ir_mode *mode); /** Gets the mode struct of a node. */ @@ -339,7 +359,7 @@ void set_Block_matured(ir_node *node, int matured); /** A visited flag only for block nodes. * @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/ -unsigned long get_Block_block_visited(ir_node *node); +unsigned long get_Block_block_visited(const ir_node *node); void set_Block_block_visited(ir_node *node, unsigned long visit); /** @@ -351,28 +371,32 @@ int is_Block_dead(const ir_node *block); /* For this current_ir_graph must be set. */ void mark_Block_block_visited(ir_node *node); -int Block_not_block_visited(ir_node *node); +int Block_not_block_visited(const ir_node *node); +int Block_block_visited(const ir_node *node); /* Set and remove interprocedural predecessors. If the interprocedural * predecessors are removed, the node has the same predecessors in * both views. * @@@ Maybe better: arity is zero if no cg preds. */ -void set_Block_cg_cfgpred_arr(ir_node * node, int arity, ir_node ** in); -void set_Block_cg_cfgpred(ir_node * node, int pos, ir_node * pred); +void set_Block_cg_cfgpred_arr(ir_node *node, int arity, ir_node *in[]); +void set_Block_cg_cfgpred(ir_node *node, int pos, ir_node *pred); /* @@@ not supported */ -ir_node **get_Block_cg_cfgpred_arr(ir_node * node); +ir_node **get_Block_cg_cfgpred_arr(ir_node *node); /** Returns the number of interprocedural predecessors. 0 if none. */ -int get_Block_cg_n_cfgpreds(ir_node * node); +int get_Block_cg_n_cfgpreds(ir_node *node); /** Return the interprocedural predecessor at position pos. */ -ir_node *get_Block_cg_cfgpred(ir_node * node, int pos); -/* frees the memory. */ -void remove_Block_cg_cfgpred_arr(ir_node * node); +ir_node *get_Block_cg_cfgpred(ir_node *node, int pos); +/** Frees the memory allocated for interprocedural predecessors. */ +void remove_Block_cg_cfgpred_arr(ir_node *node); -/** returns the extended basic block a block belongs to */ +/** Returns the extended basic block a block belongs to. */ ir_extblk *get_Block_extbb(const ir_node *block); -/** sets the extended basic block a block belongs to */ +/** Sets the extended basic block a block belongs to. */ void set_Block_extbb(ir_node *block, ir_extblk *extblk); +/** Get the Macro Block header of a (sub-) block. */ +ir_node *get_Block_MacroBlock(const ir_node *block); + /** Return the number of Keep alive node. */ int get_End_n_keepalives(ir_node *end); @@ -450,6 +474,9 @@ int get_Return_n_ress(ir_node *node); ir_node *get_Return_res(ir_node *node, int pos); void set_Return_res(ir_node *node, int pos, ir_node *res); +/** + * Possible classes for constant classification. + */ typedef enum { CNST_NULL = 0, /**< The node is a const(0). */ CNST_ONE = +1, /**< The node is a const(1). */ @@ -459,7 +486,7 @@ typedef enum { CNST_NO_CONST = 4 /**< The node is no const at all. */ } cnst_classify_t; -tarval *get_Const_tarval(ir_node *node); +tarval *get_Const_tarval(const ir_node *node); void set_Const_tarval(ir_node *node, tarval *con); /** @@ -533,21 +560,21 @@ ir_type *get_SymConst_type(ir_node *node); void set_SymConst_type(ir_node *node, ir_type *tp); /** Only to access SymConst of kind addr_name. Else assertion: */ -ident *get_SymConst_name(ir_node *node); +ident *get_SymConst_name(const ir_node *node); void set_SymConst_name(ir_node *node, ident *name); /** Only to access SymConst of kind addr_ent. Else assertion: */ -ir_entity *get_SymConst_entity(ir_node *node); +ir_entity *get_SymConst_entity(const ir_node *node); void set_SymConst_entity(ir_node *node, ir_entity *ent); /** Only to access SymConst of kind symconst_enum_const. Else assertion: */ -ir_enum_const *get_SymConst_enum(ir_node *node); +ir_enum_const *get_SymConst_enum(const ir_node *node); void set_SymConst_enum(ir_node *node, ir_enum_const *ec); /** Sets both: type and ptrinfo. Needed to treat the node independent of its semantics. Does a memcpy for the memory sym points to. */ /* write 'union': firmjni then does not create a method... */ -union symconst_symbol get_SymConst_symbol(ir_node *node); +union symconst_symbol get_SymConst_symbol(const ir_node *node); void set_SymConst_symbol(ir_node *node, union symconst_symbol sym); @@ -573,13 +600,14 @@ void set_Sel_entity (ir_node *node, ir_entity *ent); */ typedef enum { pn_Call_M_regular = 0, /**< The memory result. */ - pn_Call_T_result = 2, /**< The tuple containing all (0, 1, 2, ...) results */ - pn_Call_P_value_res_base = 4,/**< A pointer to the memory region containing copied results + pn_Call_X_regular = 1, /**< The control flow result when no exception occurs. */ + pn_Call_X_except = 2, /**< The control flow result branching to the exception handler. */ + pn_Call_T_result = 3, /**< The tuple containing all (0, 1, 2, ...) results. */ + pn_Call_M_except = 4, /**< The memory result in case the called method terminated with + an exception. */ + pn_Call_P_value_res_base = 5,/**< A pointer to the memory region containing copied results passed by value (for compound result types). */ - pn_Call_X_except = 1, /**< The control flow result branching to the exception handler */ - pn_Call_M_except = 3, /**< The memory result in case the called method terminated with - an exception */ - pn_Call_max = 5 /**< number of projections from a Call */ + pn_Call_max = 6 /**< number of projections from a Call */ } pn_Call; /* Projection numbers for Call. */ #define pn_Call_M pn_Call_M_regular @@ -640,120 +668,132 @@ void set_CallBegin_call(ir_node *node, ir_node *call); binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl, Shr, Shrs, Rot, Cmp */ int is_unop(const ir_node *node); -ir_node *get_unop_op(ir_node *node); +ir_node *get_unop_op(const ir_node *node); void set_unop_op(ir_node *node, ir_node *op); int is_binop(const ir_node *node); -ir_node *get_binop_left(ir_node *node); +ir_node *get_binop_left(const ir_node *node); void set_binop_left(ir_node *node, ir_node *left); -ir_node *get_binop_right(ir_node *node); +ir_node *get_binop_right(const ir_node *node); void set_binop_right(ir_node *node, ir_node *right); -ir_node *get_Add_left(ir_node *node); +ir_node *get_Add_left(const ir_node *node); void set_Add_left(ir_node *node, ir_node *left); -ir_node *get_Add_right(ir_node *node); +ir_node *get_Add_right(const ir_node *node); void set_Add_right(ir_node *node, ir_node *right); -ir_node *get_Sub_left(ir_node *node); +ir_node *get_Sub_left(const ir_node *node); void set_Sub_left(ir_node *node, ir_node *left); -ir_node *get_Sub_right(ir_node *node); +ir_node *get_Sub_right(const ir_node *node); void set_Sub_right(ir_node *node, ir_node *right); -ir_node *get_Minus_op(ir_node *node); +ir_node *get_Minus_op(const ir_node *node); void set_Minus_op(ir_node *node, ir_node *op); -ir_node *get_Mul_left(ir_node *node); +ir_node *get_Mul_left(const ir_node *node); void set_Mul_left(ir_node *node, ir_node *left); -ir_node *get_Mul_right(ir_node *node); +ir_node *get_Mul_right(const ir_node *node); void set_Mul_right(ir_node *node, ir_node *right); -ir_node *get_Quot_left(ir_node *node); +ir_node *get_Quot_left(const ir_node *node); void set_Quot_left(ir_node *node, ir_node *left); -ir_node *get_Quot_right(ir_node *node); +ir_node *get_Quot_right(const ir_node *node); void set_Quot_right(ir_node *node, ir_node *right); ir_node *get_Quot_mem(ir_node *node); void set_Quot_mem(ir_node *node, ir_node *mem); +ir_mode *get_Quot_resmode(const ir_node *node); +void set_Quot_resmode(ir_node *node, ir_mode *mode); /** * Projection numbers for Quot: use for Proj nodes! */ typedef enum { - pn_Quot_M, /**< Memory result. */ + pn_Quot_M, /**< Memory result. */ + pn_Quot_X_regular, /**< Execution result if no exception occurred. */ pn_Quot_X_except, /**< Execution result if exception occurred. */ pn_Quot_res, /**< Result of computation. */ pn_Quot_max /**< number of projections from a Quot */ } pn_Quot; /* Projection numbers for Quot. */ -ir_node *get_DivMod_left(ir_node *node); +ir_node *get_DivMod_left(const ir_node *node); void set_DivMod_left(ir_node *node, ir_node *left); -ir_node *get_DivMod_right(ir_node *node); +ir_node *get_DivMod_right(const ir_node *node); void set_DivMod_right(ir_node *node, ir_node *right); ir_node *get_DivMod_mem(ir_node *node); void set_DivMod_mem(ir_node *node, ir_node *mem); +ir_mode *get_DivMod_resmode(const ir_node *node); +void set_DivMod_resmode(ir_node *node, ir_mode *mode); /** * Projection numbers for DivMod: use for Proj nodes! */ typedef enum { - pn_DivMod_M, /**< Memory result. */ + pn_DivMod_M, /**< Memory result. */ + pn_DivMod_X_regular, /**< Execution result if no exception occurred. */ pn_DivMod_X_except, /**< Execution result if exception occurred. */ pn_DivMod_res_div, /**< Result of computation a / b. */ pn_DivMod_res_mod, /**< Result of computation a % b. */ pn_DivMod_max /**< number of projections from a DivMod */ } pn_DivMod; /* Projection numbers for DivMod. */ -ir_node *get_Div_left(ir_node *node); +ir_node *get_Div_left(const ir_node *node); void set_Div_left(ir_node *node, ir_node *left); -ir_node *get_Div_right(ir_node *node); +ir_node *get_Div_right(const ir_node *node); void set_Div_right(ir_node *node, ir_node *right); ir_node *get_Div_mem(ir_node *node); void set_Div_mem(ir_node *node, ir_node *mem); +ir_mode *get_Div_resmode(const ir_node *node); +void set_Div_resmode(ir_node *node, ir_mode *mode); /** * Projection numbers for Div: use for Proj nodes! */ typedef enum { - pn_Div_M, /**< Memory result. */ + pn_Div_M, /**< Memory result. */ + pn_Div_X_regular, /**< Execution result if no exception occurred. */ pn_Div_X_except, /**< Execution result if exception occurred. */ pn_Div_res, /**< Result of computation. */ pn_Div_max /**< number of projections from a Div */ } pn_Div; /* Projection numbers for Div. */ -ir_node *get_Mod_left(ir_node *node); +ir_node *get_Mod_left(const ir_node *node); void set_Mod_left(ir_node *node, ir_node *left); -ir_node *get_Mod_right(ir_node *node); +ir_node *get_Mod_right(const ir_node *node); void set_Mod_right(ir_node *node, ir_node *right); ir_node *get_Mod_mem(ir_node *node); void set_Mod_mem(ir_node *node, ir_node *mem); +ir_mode *get_Mod_resmode(const ir_node *node); +void set_Mod_resmode(ir_node *node, ir_mode *mode); /** * Projection numbers for Mod: use for Proj nodes! */ typedef enum { pn_Mod_M, /**< Memory result. */ + pn_Mod_X_regular, /**< Execution result if no exception occurred. */ pn_Mod_X_except, /**< Execution result if exception occurred. */ pn_Mod_res, /**< Result of computation. */ pn_Mod_max /**< number of projections from a Mod */ } pn_Mod; /* Projection numbers for Mod. */ -ir_node *get_Abs_op(ir_node *node); +ir_node *get_Abs_op(const ir_node *node); void set_Abs_op(ir_node *node, ir_node *op); -ir_node *get_And_left(ir_node *node); +ir_node *get_And_left(const ir_node *node); void set_And_left(ir_node *node, ir_node *left); -ir_node *get_And_right(ir_node *node); +ir_node *get_And_right(const ir_node *node); void set_And_right(ir_node *node, ir_node *right); -ir_node *get_Or_left(ir_node *node); +ir_node *get_Or_left(const ir_node *node); void set_Or_left(ir_node *node, ir_node *left); -ir_node *get_Or_right(ir_node *node); +ir_node *get_Or_right(const ir_node *node); void set_Or_right(ir_node *node, ir_node *right); -ir_node *get_Eor_left(ir_node *node); +ir_node *get_Eor_left(const ir_node *node); void set_Eor_left(ir_node *node, ir_node *left); -ir_node *get_Eor_right(ir_node *node); +ir_node *get_Eor_right(const ir_node *node); void set_Eor_right(ir_node *node, ir_node *right); -ir_node *get_Not_op(ir_node *node); +ir_node *get_Not_op(const ir_node *node); void set_Not_op(ir_node *node, ir_node *op); /** @@ -793,32 +833,32 @@ int get_negated_pnc(int pnc, ir_mode *mode); /** Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */ int get_inversed_pnc(int pnc); -ir_node *get_Cmp_left(ir_node *node); +ir_node *get_Cmp_left(const ir_node *node); void set_Cmp_left(ir_node *node, ir_node *left); -ir_node *get_Cmp_right(ir_node *node); +ir_node *get_Cmp_right(const ir_node *node); void set_Cmp_right(ir_node *node, ir_node *right); -ir_node *get_Shl_left(ir_node *node); +ir_node *get_Shl_left(const ir_node *node); void set_Shl_left(ir_node *node, ir_node *left); -ir_node *get_Shl_right(ir_node *node); +ir_node *get_Shl_right(const ir_node *node); void set_Shl_right(ir_node *node, ir_node *right); -ir_node *get_Shr_left(ir_node *node); +ir_node *get_Shr_left(const ir_node *node); void set_Shr_left(ir_node *node, ir_node *left); -ir_node *get_Shr_right(ir_node *node); +ir_node *get_Shr_right(const ir_node *node); void set_Shr_right(ir_node *node, ir_node *right); -ir_node *get_Shrs_left(ir_node *node); +ir_node *get_Shrs_left(const ir_node *node); void set_Shrs_left(ir_node *node, ir_node *left); -ir_node *get_Shrs_right(ir_node *node); +ir_node *get_Shrs_right(const ir_node *node); void set_Shrs_right(ir_node *node, ir_node *right); -ir_node *get_Rot_left(ir_node *node); +ir_node *get_Rot_left(const ir_node *node); void set_Rot_left(ir_node *node, ir_node *left); -ir_node *get_Rot_right(ir_node *node); +ir_node *get_Rot_right(const ir_node *node); void set_Rot_right(ir_node *node, ir_node *right); -ir_node *get_Conv_op(ir_node *node); +ir_node *get_Conv_op(const ir_node *node); void set_Conv_op(ir_node *node, ir_node *op); int get_Conv_strict(ir_node *node); void set_Conv_strict(ir_node *node, int flag); @@ -829,7 +869,7 @@ void set_Conv_strict(ir_node *node, int flag); * are accessed in the cast. This required some precaution, to * get the right memory into the Loads generated from the cast. */ -ir_node *get_Cast_op(ir_node *node); +ir_node *get_Cast_op(const ir_node *node); void set_Cast_op(ir_node *node, ir_node *op); ir_type *get_Cast_type(ir_node *node); void set_Cast_type(ir_node *node, ir_type *to_tp); @@ -862,8 +902,8 @@ int is_Phi(const ir_node *n); int is_Phi0(const ir_node *n); /* These routines also work for Filter nodes in interprocedural view. */ ir_node **get_Phi_preds_arr(ir_node *node); -int get_Phi_n_preds(ir_node *node); -ir_node *get_Phi_pred(ir_node *node, int pos); +int get_Phi_n_preds(const ir_node *node); +ir_node *get_Phi_pred(const ir_node *node, int pos); void set_Phi_pred(ir_node *node, int pos, ir_node *pred); ir_node *get_Filter_pred(ir_node *node); @@ -892,7 +932,8 @@ void set_memop_ptr(ir_node *node, ir_node *ptr); * Projection numbers for Load: use for Proj nodes! */ typedef enum { - pn_Load_M, /**< Memory result. */ + pn_Load_M, /**< Memory result. */ + pn_Load_X_regular, /**< Execution result if no exception occurred. */ pn_Load_X_except, /**< Execution result if exception occurred. */ pn_Load_res, /**< Result of load operation. */ pn_Load_max /**< number of projections from a Load */ @@ -911,7 +952,8 @@ void set_Load_volatility(ir_node *node, ir_volatility volatility); * Projection numbers for Store: use for Proj nodes! */ typedef enum { - pn_Store_M, /**< Memory result. */ + pn_Store_M, /**< Memory result. */ + pn_Store_X_regular, /**< Execution result if no exception occurred. */ pn_Store_X_except, /**< Execution result if exception occurred. */ pn_Store_max /**< number of projections from a Store */ } pn_Store; /* Projection numbers for Store. */ @@ -930,6 +972,7 @@ void set_Store_volatility(ir_node *node, ir_volatility volatility); */ typedef enum { pn_Alloc_M, /**< Memory result. */ + pn_Alloc_X_regular, /**< Execution result if no exception occurred. */ pn_Alloc_X_except, /**< Execution result if exception occurred. */ pn_Alloc_res, /**< Result of allocation. */ pn_Alloc_max /**< number of projections from an Alloc */ @@ -980,6 +1023,9 @@ void set_Proj_pred(ir_node *node, ir_node *pred); /** Return the projection number of a Proj node. */ long get_Proj_proj(const ir_node *node); void set_Proj_proj(ir_node *node, long proj); +long get_VProj_proj(const ir_node *node); +void set_VProj_proj(ir_node *node, long value); + ir_node **get_Tuple_preds_arr(ir_node *node); int get_Tuple_n_preds(ir_node *node); @@ -1023,10 +1069,11 @@ int get_Psi_n_conds(ir_node *node); */ typedef enum { pn_CopyB_M_regular = 0, /**< The memory result. */ - pn_CopyB_X_except = 1, /**< The control flow result branching to the exception handler */ - pn_CopyB_M_except = 2, /**< The memory result in case the runtime function terminated with + pn_CopyB_X_regular = 1, /**< Execution result if no exception occurred. */ + pn_CopyB_X_except = 2, /**< The control flow result branching to the exception handler */ + pn_CopyB_M_except = 3, /**< The memory result in case the runtime function terminated with an exception */ - pn_CopyB_max = 3 /**< number of projections from a CopyB */ + pn_CopyB_max = 4 /**< number of projections from a CopyB */ } pn_CopyB; /* Projection numbers for CopyB. */ #define pn_CopyB_M pn_CopyB_M_regular @@ -1044,11 +1091,12 @@ void set_CopyB_type(ir_node *node, ir_type *data_type); */ typedef enum { pn_InstOf_M_regular = 0, /**< The memory result. */ - pn_InstOf_X_except = 1, /**< The control flow result branching to the exception handler */ - pn_InstOf_res = 2, /**< The checked object pointer. */ - pn_InstOf_M_except = 3, /**< The memory result in case the runtime function terminated with + pn_InstOf_X_regular = 1, /**< Execution result if no exception occurred. */ + pn_InstOf_X_except = 2, /**< The control flow result branching to the exception handler */ + pn_InstOf_res = 3, /**< The checked object pointer. */ + pn_InstOf_M_except = 4, /**< The memory result in case the runtime function terminated with an exception */ - pn_InstOf_max = 4 /**< number of projections from an InstOf */ + pn_InstOf_max = 5 /**< number of projections from an InstOf */ } pn_InstOf; #define pn_InstOf_M pn_InstOf_M_regular @@ -1079,9 +1127,10 @@ void set_Raise_exo_ptr(ir_node *node, ir_node *exoptr); */ typedef enum { pn_Bound_M = 0, /**< The memory result. */ - pn_Bound_X_except = 1, /**< The control flow result branching to the exception handler */ - pn_Bound_res = 2, /**< The checked index. */ - pn_Bound_max = 3 /**< number of projections from a Bound */ + pn_Bound_X_regular = 1, /**< Execution result if no exception occurred. */ + pn_Bound_X_except = 2, /**< The control flow result branching to the exception handler */ + pn_Bound_res = 3, /**< The checked index. */ + pn_Bound_max = 4 /**< number of projections from a Bound */ } pn_Bound; /** Returns the memory input of a Bound operation. */ @@ -1101,7 +1150,7 @@ ir_node *get_Bound_upper(ir_node *bound); void set_Bound_upper(ir_node *bound, ir_node *upper); /** Return the operand of a Pin node. */ -ir_node *get_Pin_op(ir_node *pin); +ir_node *get_Pin_op(const ir_node *pin); void set_Pin_op(ir_node *pin, ir_node *node); @@ -1130,6 +1179,8 @@ ir_node *skip_Confirm(ir_node *node); ir_node *skip_HighLevel(ir_node *node); /** returns true if irn is a Const node. */ int is_Const(const ir_node *node); +/** returns true if a node is a Conv node */ +int is_Conv(const ir_node *node); /** returns true if node is a Bad node. */ int is_Bad(const ir_node *node); /** returns true if node is a NoMem node. */ @@ -1144,6 +1195,10 @@ int is_Div(const ir_node *node); int is_DivMod(const ir_node *node); /** return true if node is a Quot node. */ int is_Quot(const ir_node *node); +/** return true if node is an Add node. */ +int is_Add(const ir_node *node); +/** return true if node is a Sub node. */ +int is_Sub(const ir_node *node); /** returns true if the node is not a Block */ int is_no_Block(const ir_node *node); /** returns true if the node is a Block */ @@ -1156,6 +1211,8 @@ int is_Return(const ir_node *node); int is_Call(const ir_node *node); /** returns true if node is a Sel node. */ int is_Sel(const ir_node *node); +/** returns true if node is a Mul node. */ +int is_Mul(const ir_node *node); /** returns true if node is a Mux node or a Psi with only one condition. */ int is_Mux(const ir_node *node); /** returns true if node is a Load node. */ @@ -1198,6 +1255,8 @@ int is_ip_cfop(const ir_node *node); int is_fragile_op(const ir_node *node); /** Returns the memory operand of fragile operations. */ ir_node *get_fragile_op_mem(ir_node *node); +/** Returns the result mode of a Div operation. */ +ir_mode *get_divop_resmod(const ir_node *node); /** Returns true if the operation is a forking control flow * operation: Cond. */ @@ -1263,7 +1322,7 @@ typedef enum { const char *get_cond_jmp_predicate_name(cond_jmp_predicate pred); /** Returns the conditional jump prediction of a Cond node. */ -cond_jmp_predicate get_Cond_jmp_pred(ir_node *cond); +cond_jmp_predicate get_Cond_jmp_pred(const ir_node *cond); /** Sets a new conditional jump prediction. */ void set_Cond_jmp_pred(ir_node *cond, cond_jmp_predicate pred); @@ -1303,6 +1362,7 @@ unsigned register_additional_node_data(unsigned size); * Needed for user-defined nodes. */ void *get_irn_generic_attr(ir_node *node); +const void *get_irn_generic_attr_const(const ir_node *node); /** * Returns the unique node index for the node in its graph. @@ -1372,4 +1432,4 @@ int dump_node_opcode(FILE *F, ir_node *n); } #endif -#endif /* _FIRM_IR_IRNODE_H_ */ +#endif