X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode.c;h=cc871e545829bd8e65674377cd91ba0bc3cbbf6e;hb=cd05b35df4f0a2af7c4edc94e37f973843e9a547;hp=ae684fff62852cefad1288149207154deaa986bb;hpb=ded7dce31440d497b37b3403d6026f3ed25c5764;p=libfirm diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index ae684fff6..cc871e545 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -64,7 +64,8 @@ static const char *pnc_name_arr [] = { * returns the pnc name from an pnc constant */ const char *get_pnc_string(int pnc) { - assert(pnc >= 0 && pnc < sizeof(pnc_name_arr)/sizeof(pnc_name_arr[0])); + assert(pnc >= 0 && pnc < + (int) (sizeof(pnc_name_arr)/sizeof(pnc_name_arr[0]))); return pnc_name_arr[pnc]; } @@ -107,7 +108,7 @@ unsigned firm_add_node_size = 0; /* register new space for every node */ -unsigned register_additional_node_data(unsigned size) { +unsigned firm_register_additional_node_data(unsigned size) { assert(!forbid_new_data && "Too late to register additional node data"); if (forbid_new_data) @@ -130,8 +131,8 @@ init_irnode(void) { * If arity is negative, a node with a dynamic array is created. */ ir_node * -new_ir_node (dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mode, - int arity, ir_node **in) +new_ir_node(dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mode, + int arity, ir_node **in) { ir_node *res; size_t node_size = offsetof(ir_node, attr) + op->attr_size + firm_add_node_size; @@ -430,7 +431,7 @@ void _set_irn_op(node, op); } -ir_opcode +unsigned (get_irn_opcode)(const ir_node *node) { return _get_irn_opcode(node); } @@ -522,10 +523,22 @@ void firm_set_irn_section(ir_node *n, struct section *s) { } #else /* Dummies needed for firmjni. */ -struct abstval *get_irn_abst_value(ir_node *n) { return NULL; } -void set_irn_abst_value(ir_node *n, struct abstval *os) {} -struct section *firm_get_irn_section(ir_node *n) { return NULL; } -void firm_set_irn_section(ir_node *n, struct section *s) {} +struct abstval *get_irn_abst_value(ir_node *n) { + (void) n; + return NULL; +} +void set_irn_abst_value(ir_node *n, struct abstval *os) { + (void) n; + (void) os; +} +struct section *firm_get_irn_section(ir_node *n) { + (void) n; + return NULL; +} +void firm_set_irn_section(ir_node *n, struct section *s) { + (void) n; + (void) s; +} #endif /* DO_HEAPANALYSIS */ @@ -539,10 +552,10 @@ long get_irn_node_nr(const ir_node *node) { #endif } -const_attr +const_attr * get_irn_const_attr(ir_node *node) { assert(node->op == op_Const); - return node->attr.con; + return &node->attr.con; } long @@ -551,22 +564,22 @@ get_irn_proj_attr(ir_node *node) { return node->attr.proj; } -alloc_attr +alloc_attr * get_irn_alloc_attr(ir_node *node) { assert(node->op == op_Alloc); - return node->attr.alloc; + return &node->attr.alloc; } -free_attr +free_attr * get_irn_free_attr(ir_node *node) { assert(node->op == op_Free); - return node->attr.free; + return &node->attr.free; } -symconst_attr +symconst_attr * get_irn_symconst_attr(ir_node *node) { assert(node->op == op_SymConst); - return node->attr.symc; + return &node->attr.symc; } ir_type * @@ -575,10 +588,10 @@ get_irn_call_attr(ir_node *node) { return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp); } -sel_attr +sel_attr * get_irn_sel_attr(ir_node *node) { assert(node->op == op_Sel); - return node->attr.sel; + return &node->attr.sel; } int @@ -587,29 +600,29 @@ get_irn_phi0_attr(ir_node *node) { return node->attr.phi0.pos; } -block_attr +block_attr * get_irn_block_attr(ir_node *node) { assert(node->op == op_Block); - return node->attr.block; + return &node->attr.block; } -load_attr +load_attr * get_irn_load_attr(ir_node *node) { assert(node->op == op_Load); - return node->attr.load; + return &node->attr.load; } -store_attr +store_attr * get_irn_store_attr(ir_node *node) { assert(node->op == op_Store); - return node->attr.store; + return &node->attr.store; } -except_attr +except_attr * get_irn_except_attr(ir_node *node) { assert(node->op == op_Div || node->op == op_Quot || node->op == op_DivMod || node->op == op_Mod || node->op == op_Call || node->op == op_Alloc); - return node->attr.except; + return &node->attr.except; } void *(get_irn_generic_attr)(ir_node *node) { @@ -2565,11 +2578,36 @@ int return _is_Add(node); } +int +(is_And)(const ir_node *node) { + return _is_And(node); +} + +int +(is_Or)(const ir_node *node) { + return _is_Or(node); +} + +int +(is_Eor)(const ir_node *node) { + return _is_Eor(node); +} + int (is_Sub)(const ir_node *node) { return _is_Sub(node); } +int +(is_Not)(const ir_node *node) { + return _is_Not(node); +} + +int +(is_Psi)(const ir_node *node) { + return _is_Psi(node); +} + int (is_Tuple)(const ir_node *node) { return _is_Tuple(node); @@ -2856,6 +2894,7 @@ void (set_Cond_jmp_pred)(ir_node *cond, cond_jmp_predicate pred) { /** the get_type operation must be always implemented and return a firm type */ static ir_type *get_Default_type(ir_node *n) { + (void) n; return get_unknown_type(); } @@ -2893,6 +2932,7 @@ static ir_entity *get_SymConst_attr_entity(ir_node *self) { /** the get_type_attr operation must be always implemented */ static ir_type *get_Null_type(ir_node *n) { + (void) n; return firm_unknown_type; } @@ -2915,6 +2955,7 @@ ir_op_ops *firm_set_default_get_type_attr(ir_opcode code, ir_op_ops *ops) { /** the get_entity_attr operation must be always implemented */ static ir_entity *get_Null_ent(ir_node *n) { + (void) n; return NULL; } @@ -2932,6 +2973,22 @@ ir_op_ops *firm_set_default_get_entity_attr(ir_opcode code, ir_op_ops *ops) { return ops; } +/* Sets the debug information of a node. */ +void (set_irn_dbg_info)(ir_node *n, dbg_info *db) { + _set_irn_dbg_info(n, db); +} + +/** + * Returns the debug information of an node. + * + * @param n The node. + */ +dbg_info *(get_irn_dbg_info)(const ir_node *n) { + return _get_irn_dbg_info(n); +} + + + #ifdef DEBUG_libfirm void dump_irn(ir_node *n) { int i, arity = get_irn_arity(n);