X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fircons.h;h=adfa04de8a0a7d62c8c7dd9b4696772e65366706;hb=5bfb295525b0e0811b61106bb47375e2aaf77c54;hp=cea2b084491bc4d558476ada65bd34639e920c4b;hpb=b7a5ce5b106f04855de40e9929cefcfff44247b9;p=libfirm diff --git a/include/libfirm/ircons.h b/include/libfirm/ircons.h index cea2b0844..adfa04de8 100644 --- a/include/libfirm/ircons.h +++ b/include/libfirm/ircons.h @@ -299,7 +299,7 @@ * ir_node *new_Borrow (ir_node *op1, ir_node *op2, ir_mode *mode); * ir_node *new_Load (ir_node *store, ir_node *addr, ir_mode *mode, ir_cons_flags flags); * ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags flags); - * ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type, + * ir_node *new_Alloc (ir_node *store, ir_node *count, ir_type *alloc_type, * where_alloc where); * ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size, * ir_type *free_type, where_alloc where); @@ -327,7 +327,6 @@ * All ir_nodes are defined by a common data structure. They are distinguished * by their opcode and differ in the number of their attributes. * - * The constructor for the block node sets current_block to itself. * Const nodes are always added to the start block. * All other constructors add the created node to the current_block. * swich_block(block) allows to set the current block to block. @@ -536,30 +535,24 @@ * attr.con A tarval* pointer to the proper entry in the constant * table. * - * ir_node *new_SymConst (ir_mode *mode,union symconst_symbol value, symconst_addr_ent kind) + * ir_node *new_SymConst (ir_mode *mode, union symconst_symbol value, symconst_addr_ent kind) * ----------------------------------------------------------------------------------------- * - * There are three five of symbolic constants: + * There are several symbolic constants: * symconst_type_tag The symbolic constant represents a type tag. * symconst_type_size The symbolic constant represents the size of a type. * symconst_type_align The symbolic constant represents the alignment of a type. - * symconst_addr_name Information for the linker, e.g. the name of a global - * variable. * symconst_addr_ent The symbolic constant represents the address of an entity. - * - * To represent a pointer to an entity that is represented by an entity - * datastructure don't use - * new_SymConst((type_or_id*)get_entity_ld_ident(ent), symconst_addr_name);. - * Use a real const instead: - * new_SymConst(ent, symconst_addr_ent); - * This makes the Constant independent of name changes of the entity due to - * mangling. + * symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * symconst_enum_const The symbolic constant is a enumeration constant of an + * enumeration type. * * Parameters - * kind The kind of the symbolic constant: type_tag, size or link_info. - * *type_or_id Points to the type the tag stands for or to the type - * whose size is represented by the constant or to an ident - * representing the linkage info. + * mode P for SymConsts representing addresses, Iu otherwise. + * value The type, ident, entity or enum constant, depending on the + * kind + * kind The kind of the symbolic constant, see the list above. * * Inputs: * No inputs except the block it belongs to. @@ -571,7 +564,6 @@ * -symconst_type_tag * -symconst_type_size * -symconst_type_align - * -symconst_addr_name * -symconst_addr_ent * * If the attr.i.num is symconst_type_tag, symconst_type_size or symconst_type_align, @@ -906,7 +898,7 @@ * A tuple of the changed memory and a control flow to be taken in * case of an exception. * - * ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type, + * ir_node *new_Alloc (ir_node *store, ir_node *count, ir_type *alloc_type, * ----------------------------------------------------------------------- * where_alloc where) * ------------------ @@ -916,10 +908,8 @@ * * Parameters: * *store The memory which shall contain the new variable. - * ** *size The number of bytes to allocate. Old. ** - * *size We decided that the size easily can be derived from the type. - * This field is for allocating arrays, i.e., it gives the multiple - * of the size of alloc_type to allocate memory for. + * *count This field is for allocating arrays, i.e., it gives the multiple + * of the size of alloc_type to allocate memory for. * *alloc_type The type of the allocated variable. * where Where to allocate the variable, either heap_alloc or stack_alloc. * @@ -1162,11 +1152,7 @@ typedef enum ir_cons_flags { /** Constructor for a Block node. * - * Constructs a mature block with the given predecessors. Use Unknown - * nodes as predecessors to construct a block if the number of - * predecessors is known, but not the predecessors themselves. This - * constructor does not set current_block. It not be used with - * automatic Phi node construction. + * Constructs a mature block with the given predecessors. * * @param *db A Pointer for debug information. * @param irg The IR graph the block belongs to. @@ -1284,7 +1270,8 @@ ir_node *new_rd_Const_type(dbg_info *db, ir_graph *irg, */ ir_node *new_rd_Const(dbg_info *db, ir_graph *irg, tarval *con); -/** Constructor for a Const node. +/** + * Constructor for a Const node. * * Adds the node to the start block. * @@ -1303,21 +1290,22 @@ ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg, /** Constructor for a SymConst_type node. * * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * - type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * - type_size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * - type_align The symbolic constant represents the alignment of a type. The - * type of which the constant represents the size is given - * explicitly. - * - addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * - addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * There are several kinds of symbolic constants: + * - symconst_type_tag The symbolic constant represents a type tag. The + * type the tag stands for is given explicitly. + * - symconst_type_size The symbolic constant represents the size of a type. + * The type of which the constant represents the size + * is given explicitly. + * - symconst_type_align The symbolic constant represents the alignment of a + * type. The type of which the constant represents the + * size is given explicitly. + * - symconst_addr_ent The symbolic constant represents the address of an + * entity (variable or method). The variable is given + * explicitly by a firm entity. + * - symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * - symconst_enum_const The symbolic constant is a enumeration constant of + * an enumeration type. * * Inputs to the node: * No inputs except the block it belongs to. @@ -1330,20 +1318,21 @@ ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg, * @param *db A pointer for debug information. * @param *irg The IR graph the node belongs to. * @param mode The mode for the SymConst. - * @param symkind The kind of the symbolic constant: type_tag, size, addr_name or addr_ent. - * @param value A type, entity or a ident depending on the SymConst kind. + * @param value A type, ident, entity or enum constant depending on the + * SymConst kind. + * @param kind The kind of the symbolic constant, see the list above * @param tp The source type of the constant. */ ir_node *new_rd_SymConst_type(dbg_info *db, ir_graph *irg, ir_mode *mode, - union symconst_symbol value, - symconst_kind symkind, ir_type *tp); + union symconst_symbol value, symconst_kind kind, + ir_type *tp); /** Constructor for a SymConst node. * * Same as new_rd_SymConst_type, except that it sets the type to type_unknown. */ ir_node *new_rd_SymConst(dbg_info *db, ir_graph *irg, ir_mode *mode, - union symconst_symbol value, symconst_kind symkind); + union symconst_symbol value, symconst_kind kind); /** Constructor for a SymConst addr_ent node. * @@ -1362,19 +1351,10 @@ ir_node *new_rd_SymConst_addr_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_node *new_rd_SymConst_ofs_ent(dbg_info *db, ir_graph *irg, ir_mode *mode, ir_entity *symbol, ir_type *tp); -/** Constructor for a SymConst addr_name node. - * - * Same as new_rd_SymConst_type, except that the constructor is tailored for - * symconst_addr_ent. - * Adds the SymConst to the start block of irg. - */ -ir_node *new_rd_SymConst_addr_name(dbg_info *db, ir_graph *irg, ir_mode *mode, - ident *symbol, ir_type *tp); - /** Constructor for a SymConst type_tag node. * * Same as new_rd_SymConst_type, except that the constructor is tailored for - * symconst_addr_ent. + * symconst_type_tag. * Adds the SymConst to the start block of irg. */ ir_node *new_rd_SymConst_type_tag(dbg_info *db, ir_graph *irg, ir_mode *mode, @@ -1451,7 +1431,7 @@ ir_node *new_rd_Sel(dbg_info *db, ir_node *block, ir_node *store, ir_node *new_rd_Call(dbg_info *db, ir_node *block, ir_node *store, ir_node *callee, int arity, ir_node *in[], ir_type *tp); -/** Constructor for a ´Builtin node. +/** Constructor for a Builtin node. * * Represents a call of a backend-specific builtin.. * @@ -1785,12 +1765,12 @@ ir_node *new_rd_Store(dbg_info *db, ir_node *block, ir_node *store, * @param *db A pointer for debug information. * @param *block The IR block the node belongs to. * @param *store The memory which shall contain the new variable. - * @param *size The number of bytes to allocate. + * @param *count The number of objects to allocate. * @param *alloc_type The type of the allocated variable. * @param where Where to allocate the variable, either heap_alloc or stack_alloc. */ ir_node *new_rd_Alloc(dbg_info *db, ir_node *block, ir_node *store, - ir_node *size, ir_type *alloc_type, ir_where_alloc where); + ir_node *count, ir_type *alloc_type, ir_where_alloc where); /** Constructor for a Free node. * @@ -1828,25 +1808,21 @@ ir_node *new_rd_Sync(dbg_info *db, ir_node *block, int arity, ir_node *in[]); * position of the value within the tuple. * * @param *db A pointer for debug information. - * @param *block The IR block the node belongs to. * @param arg A node producing a tuple. The node must have mode_T. * @param *mode The mode of the value to project. * @param proj The position of the value in the tuple. */ -ir_node *new_rd_Proj(dbg_info *db, ir_node *block, ir_node *arg, - ir_mode *mode, long proj); +ir_node *new_rd_Proj(dbg_info *db, ir_node *arg, ir_mode *mode, long proj); /** Constructor for a defaultProj node. * * Represents the default control flow of a Switch-Cond node. * * @param *db A pointer for debug information. - * @param *block The IR block the node belongs to. * @param arg A node producing a tuple. * @param max_proj The end position of the value in the tuple. */ -ir_node *new_rd_defaultProj(dbg_info *db, ir_node *block, - ir_node *arg, long max_proj); +ir_node *new_rd_defaultProj(dbg_info *db, ir_node *arg, long max_proj); /** Constructor for a Tuple node. * @@ -1895,6 +1871,7 @@ ir_node *new_rd_Confirm(dbg_info *db, ir_node *block, * * Represents an arbitrary value. Places the node in the start block. * + * @param *db A pointer for debug information. * @param *irg The IR graph the node belongs to. * @param *m The mode of the unknown value. */ @@ -1909,7 +1886,8 @@ ir_node *new_rd_Unknown(dbg_info *db, ir_graph *irg, ir_mode *m); * * @param *db A pointer for debug information. * @param *block The block the node belong to. - * @param *callee The call node visible in the intra procedural view. + * @param *ptr pointer to the called function + * @param *call associated call operation */ ir_node *new_rd_CallBegin(dbg_info *db, ir_node *block, ir_node *ptr, ir_node *call); @@ -2130,7 +2108,6 @@ ir_node *new_r_Return(ir_node *block, ir_node *store, int arity, ir_node *in[]); * Derives mode from passed tarval. * * @param *irg The IR graph the node belongs to. - * @param *block The IR block the node belongs to. * @param *con Points to an entry in the constant table. */ ir_node *new_r_Const(ir_graph *irg, tarval *con); @@ -2166,31 +2143,39 @@ ir_node *new_r_Const_type(ir_graph *irg, tarval *con, ir_type *tp); /** Constructor for a SymConst node. * * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * - type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * - size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * - addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * - addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * There are several kinds of symbolic constants: + * - symconst_type_tag The symbolic constant represents a type tag. The + * type the tag stands for is given explicitly. + * - symconst_type_size The symbolic constant represents the size of a type. + * The type of which the constant represents the size + * is given explicitly. + * - symconst_type_align The symbolic constant represents the alignment of a + * type. The type of which the constant represents the + * size is given explicitly. + * - symconst_addr_ent The symbolic constant represents the address of an + * entity (variable or method). The variable is given + * explicitly by a firm entity. + * - symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * - symconst_enum_const The symbolic constant is a enumeration constant of + * an enumeration type. * * Inputs to the node: * No inputs except the block it belongs to. * Outputs of the node. * An unsigned integer (I_u) or a pointer (P). * + * Mention union in declaration so that the firmjni generator recognizes that + * it can not cast the argument to an int. + * * @param *irg The IR graph the node belongs to. * @param mode The mode for the SymConst. - * @param value A type, entity or a ident depending on the SymConst kind. - * @param symkind The kind of the symbolic constant: type_tag, size or link_info. + * @param value A type, ident, entity or enum constant depending on the + * SymConst kind. + * @param kind The kind of the symbolic constant, see the list above */ ir_node *new_r_SymConst(ir_graph *irg, ir_mode *mode, - union symconst_symbol value, symconst_kind symkind); + union symconst_symbol value, symconst_kind kind); /** Constructor for a simpleSel node. * @@ -2279,7 +2264,6 @@ ir_node *new_r_Sub(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode); /** Constructor for a Minus node. * - * @param *irg The IR graph the node belongs to. * @param *block The IR block the node belongs to. * @param *op The operand. * @param *mode The mode of the operand and the result. @@ -2288,7 +2272,6 @@ ir_node *new_r_Minus(ir_node *block, ir_node *op, ir_mode *mode); /** Constructor for a Mul node. * - * @param *irg The IR graph the node belongs to. * @param *block The IR block the node belongs to. * @param *op1 The first operand. * @param *op2 The second operand. @@ -2298,7 +2281,6 @@ ir_node *new_r_Mul(ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode); /** Constructor for a Mulh node. * - * @param *irg The IR graph the node belongs to. * @param *block The IR block the node belongs to. * @param *op1 The first operand. * @param *op2 The second operand. @@ -2536,12 +2518,12 @@ ir_node *new_r_Store(ir_node *block, ir_node *store, * * @param *block The IR block the node belongs to. * @param *store The memory which shall contain the new variable. - * @param *size The number of bytes to allocate. + * @param *count The number of objects to allocate. * @param *alloc_type The type of the allocated variable. * @param where Where to allocate the variable, either heap_alloc or stack_alloc. */ ir_node *new_r_Alloc(ir_node *block, ir_node *store, - ir_node *size, ir_type *alloc_type, ir_where_alloc where); + ir_node *count, ir_type *alloc_type, ir_where_alloc where); /** Constructor for a Free node. * @@ -2576,23 +2558,20 @@ ir_node *new_r_Sync(ir_node *block, int arity, ir_node *in[]); * Projects a single value out of a tuple. The parameter proj gives the * position of the value within the tuple. * - * @param *block The IR block the node belongs to. * @param arg A node producing a tuple. - * @param *mode The mode of the value to project. + * @param mode The mode of the value to project. * @param proj The position of the value in the tuple. */ -ir_node *new_r_Proj(ir_node *block, ir_node *arg, - ir_mode *mode, long proj); +ir_node *new_r_Proj(ir_node *arg, ir_mode *mode, long proj); /** Constructor for a defaultProj node. * * Represents the default control flow of a Switch-Cond node. * - * @param *block The IR block the node belongs to. * @param arg A node producing a tuple. * @param max_proj The end position of the value in the tuple. */ -ir_node *new_r_defaultProj(ir_node *block, ir_node *arg, long max_proj); +ir_node *new_r_defaultProj(ir_node *arg, long max_proj); /** Constructor for a Tuple node. @@ -2659,7 +2638,8 @@ ir_node *new_r_Unknown(ir_graph *irg, ir_mode *m); * node. * * @param *block The block the node belong to. - * @param *callee The call node visible in the intra procedural view. + * @param *ptr pointer to the called function + * @param *call associated call operation */ ir_node *new_r_CallBegin(ir_node *block, ir_node *ptr, ir_node *call); @@ -2815,17 +2795,10 @@ void set_cur_block(ir_node *target); /** Returns the current block of the current graph. */ ir_node *get_cur_block(void); -/** Returns the fixed nodes of the current graph. */ -#define get_cur_end_block() get_irg_end_block(current_ir_graph) -#define get_cur_end() get_irg_end(current_ir_graph) -#define get_cur_start_block() get_irg_start_block(current_ir_graph) -#define get_cur_start() get_irg_start(current_ir_graph) - /** Constructor for a Block node. * * Adds the block to the graph in current_ir_graph. Constructs a Block - * with a fixed number of predecessors. Does set current_block. Can - * be used with automatic Phi node construction. + * with a fixed number of predecessors. * * @param *db A Pointer for debug information. * @param arity The number of control predecessors. @@ -2930,33 +2903,48 @@ ir_node *new_d_Const_type(dbg_info *db, tarval *con, ir_type *tp); */ ir_node *new_d_Const(dbg_info *db, tarval *con); +/** + * @see new_rd_Const_long() + * + * @param *db A pointer for debug information. + * @param *mode The mode of the operands and results. + * @param value A value from which the tarval is made. + */ +ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value); + /** Constructor for a SymConst_type node. * - * Adds the node to the block in current_ir_block. * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * - type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * - size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * - addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * - addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * There are several kinds of symbolic constants: + * - symconst_type_tag The symbolic constant represents a type tag. The + * type the tag stands for is given explicitly. + * - symconst_type_size The symbolic constant represents the size of a type. + * The type of which the constant represents the size + * is given explicitly. + * - symconst_type_align The symbolic constant represents the alignment of a + * type. The type of which the constant represents the + * size is given explicitly. + * - symconst_addr_ent The symbolic constant represents the address of an + * entity (variable or method). The variable is given + * explicitly by a firm entity. + * - symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * - symconst_enum_const The symbolic constant is a enumeration constant of + * an enumeration type. * * Inputs to the node: * No inputs except the block it belongs to. * Outputs of the node. * An unsigned integer (I_u) or a pointer (P). * + * Mention union in declaration so that the firmjni generator recognizes that + * it can not cast the argument to an int. + * * @param *db A pointer for debug information. * @param mode The mode for the SymConst. - * @param value A type, entity or ident depending on the SymConst kind. - * @param kind The kind of the symbolic constant: symconst_type_tag, symconst_type_size, - * symconst_type_align, symconst_addr_name or symconst_addr_ent. + * @param value A type, ident, entity or enum constant depending on the + * SymConst kind. + * @param kind The kind of the symbolic constant, see the list above * @param tp The source type of the constant. */ ir_node *new_d_SymConst_type(dbg_info *db, ir_mode *mode, @@ -3356,11 +3344,11 @@ ir_node *new_d_Store(dbg_info *db, ir_node *store, ir_node *addr, ir_node *val, * * @param *db A pointer for debug information. * @param *store The memory which shall contain the new variable. - * @param *size The number of bytes to allocate. + * @param *count The number of objects to allocate. * @param *alloc_type The type of the allocated variable. * @param where Where to allocate the variable, either heap_alloc or stack_alloc. */ -ir_node *new_d_Alloc(dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type, +ir_node *new_d_Alloc(dbg_info *db, ir_node *store, ir_node *count, ir_type *alloc_type, ir_where_alloc where); /** Constructor for a Free node. @@ -3460,6 +3448,7 @@ ir_node *new_d_Confirm(dbg_info *db, ir_node *val, ir_node *bound, pn_Cmp cmp); * Represents an arbitrary value. Places the node in * the start block. * + * @param *db A pointer for debug information. * @param *m The mode of the unknown value. */ ir_node *new_d_Unknown(dbg_info *db, ir_mode *m); @@ -3472,7 +3461,8 @@ ir_node *new_d_Unknown(dbg_info *db, ir_mode *m); * node.Adds the node to the block in current_ir_block. * * @param *db A pointer for debug information. - * @param *callee The call node visible in the intra procedural view. + * @param *ptr pointer to the called function + * @param *call associated call operation */ ir_node *new_d_CallBegin(dbg_info *db, ir_node *ptr, ir_node *call); @@ -3608,15 +3598,10 @@ ir_node *new_d_ASM(dbg_info *db, int arity, ir_node *in[], ir_asm_constraint *in /* The block oriented interface without debug support */ /*-----------------------------------------------------------------------*/ -/* Needed from the interface with debug support: -void set_cur_block (ir_node *target); */ - /** Constructor for a Block node. * * Constructor for a Block node. Adds the block to the graph in - * current_ir_graph. Constructs a Block with a fixed number of - * predecessors. Does set current_block. Can be used with automatic - * Phi node construction. + * current_ir_graph. Constructs a Block with a fixed number of predecessors. * * @param arity The number of control predecessors. * @param in An array of control predecessors. The length of @@ -3733,68 +3718,74 @@ ir_node *new_Const_long(ir_mode *mode, long value); * Derives mode from passed tarval. */ ir_node *new_Const_type(tarval *con, ir_type *tp); -/** Constructor for a SymConst node. +/** Constructor for a SymConst_type node. * - * Adds the node to the block in current_ir_block. - * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * -# type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * -# size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * -# align The symbolic constant represents the alignment of a type. The - * type of which the constant represents the size is given - * explicitly. - * -# addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * -# addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * This is the constructor for a symbolic constant. + * There are several kinds of symbolic constants: + * - symconst_type_tag The symbolic constant represents a type tag. The + * type the tag stands for is given explicitly. + * - symconst_type_size The symbolic constant represents the size of a type. + * The type of which the constant represents the size + * is given explicitly. + * - symconst_type_align The symbolic constant represents the alignment of a + * type. The type of which the constant represents the + * size is given explicitly. + * - symconst_addr_ent The symbolic constant represents the address of an + * entity (variable or method). The variable is given + * explicitly by a firm entity. + * - symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * - symconst_enum_const The symbolic constant is a enumeration constant of + * an enumeration type. * * Inputs to the node: * No inputs except the block it belongs to. * Outputs of the node. * An unsigned integer (I_u) or a pointer (P). * + * Mention union in declaration so that the firmjni generator recognizes that + * it can not cast the argument to an int. + * * @param mode The mode for the SymConst. - * @param value A type or a ident depending on the SymConst kind. - * @param kind The kind of the symbolic constant: symconst_type_tag, symconst_type_size - * symconst_type_align, symconst_addr_name or symconst_addr_ent. + * @param value A type, ident, entity or enum constant depending on the + * SymConst kind. + * @param kind The kind of the symbolic constant, see the list above * @param tp The source type of the constant. */ ir_node *new_SymConst_type(ir_mode *mode, union symconst_symbol value, symconst_kind kind, ir_type *tp); /** Constructor for a SymConst node. * - * Adds the node to the block in current_ir_block. - * This is the constructor for a symbolic constant. - * There are four kinds of symbolic constants: - * -# type_tag The symbolic constant represents a type tag. The type the - * tag stands for is given explicitly. - * -# size The symbolic constant represents the size of a type. The - * type of which the constant represents the size is given - * explicitly. - * -# align The symbolic constant represents the alignment of a type. The - * type of which the constant represents the size is given - * explicitly. - * -# addr_name The symbolic constant represents the address of an entity - * (variable or method). The variable is indicated by a name - * that is valid for linking. - * -# addr_ent The symbolic constant represents the address of an entity - * (variable or method). The variable is given explicitly by - * a firm entity. + * This is the constructor for a symbolic constant. + * There are several kinds of symbolic constants: + * - symconst_type_tag The symbolic constant represents a type tag. The + * type the tag stands for is given explicitly. + * - symconst_type_size The symbolic constant represents the size of a type. + * The type of which the constant represents the size + * is given explicitly. + * - symconst_type_align The symbolic constant represents the alignment of a + * type. The type of which the constant represents the + * size is given explicitly. + * - symconst_addr_ent The symbolic constant represents the address of an + * entity (variable or method). The variable is given + * explicitly by a firm entity. + * - symconst_ofs_ent The symbolic constant represents the offset of an + * entity in its owner type. + * - symconst_enum_const The symbolic constant is a enumeration constant of + * an enumeration type. * * Inputs to the node: * No inputs except the block it belongs to. * Outputs of the node. * An unsigned integer (I_u) or a pointer (P). * + * Mention union in declaration so that the firmjni generator recognizes that + * it can not cast the argument to an int. + * * @param mode The mode for the SymConst. - * @param value A type or a ident depending on the SymConst kind. - * @param kind The kind of the symbolic constant: symconst_type_tag, symconst_type_size - * symconst_type_align, symconst_addr_name or symconst_addr_ent. + * @param value A type, ident, entity or enum constant depending on the + * SymConst kind. + * @param kind The kind of the symbolic constant, see the list above */ ir_node *new_SymConst(ir_mode *mode, union symconst_symbol value, symconst_kind kind); @@ -3866,7 +3857,8 @@ ir_node *new_Builtin(ir_node *store, int arity, ir_node *in[], * constructor copies the method pointer input from the passed Call * node. Adds the node to the block in current_ir_block. * - * @param *callee A pointer to the called procedure. + * @param *ptr pointer to the called function + * @param *call associated call operation */ ir_node *new_CallBegin(ir_node *ptr, ir_node *call); @@ -4153,11 +4145,11 @@ ir_node *new_Store(ir_node *store, ir_node *addr, ir_node *val, ir_cons_flags fl * Adds the node to the block in current_ir_block. * * @param *store The memory which shall contain the new variable. - * @param *size The number of bytes to allocate. + * @param *count The number of objects to allocate. * @param *alloc_type The type of the allocated variable. * @param where Where to allocate the variable, either heap_alloc or stack_alloc. */ -ir_node *new_Alloc(ir_node *store, ir_node *size, ir_type *alloc_type, +ir_node *new_Alloc(ir_node *store, ir_node *count, ir_type *alloc_type, ir_where_alloc where); /** Constructor for a Free node. @@ -4361,15 +4353,41 @@ ir_node *new_ASM(int arity, ir_node *in[], ir_asm_constraint *inputs, int n_outs, ir_asm_constraint *outputs, int n_clobber, ident *clobber[], ident *asm_text); -/** Constructor for a Dummy node. +/** + * @brief Constructor for a Dummy node. * + * @param *db debug info for the node * @param *mode The mode of the node. + * @param *irg the graph to put the node into + * @returns the newly created note */ -ir_node *new_Dummy(ir_mode *mode); +ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode); +/** + * @copybrief new_rd_Dummy() + * + * @param *mode The mode of the node. + * @param *irg the graph to put the node into + * @returns the newly created note + */ ir_node *new_r_Dummy(ir_graph *irg, ir_mode *mode); -ir_node *new_rd_Dummy(dbg_info *db, ir_graph *irg, ir_mode *mode); +/** + * @copybrief new_rd_Dummy() + * + * @param *db debug info for the node + * @param *mode The mode of the node. + * @returns the newly created note + */ +ir_node *new_d_Dummy(dbg_info *db, ir_mode *mode); + +/** + * @copybrief new_rd_Dummy() + * + * @param *mode The mode of the node. + * @returns the newly created note + */ +ir_node *new_Dummy(ir_mode *mode); /*---------------------------------------------------------------------*/ /* The comfortable interface. */ @@ -4438,15 +4456,13 @@ ir_node *get_value(int pos, ir_mode *mode); */ void set_value(int pos, ir_node *value); -/** Find the value number for a node in the current block. +/** + * Find the value number for a node in the current block. * - * This function searches all values in the current block for - * a given value and returns its value number if it was found, else - * -1. - * Note that this does not mean that the value does not exists, - * it's just not equal the node (for instance behind a Phi/Confirm ...) + * @param value the searched value * - * @param *value The value to find. + * @return the value number of the value or -1 if this value has + * no value number in the current block. */ int find_value(ir_node *value);