X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firnode_t.h;h=0b8c4c64d672d1569048ffe6884945ed7a47d9a5;hb=fa6fdc19998fbdcac9388070fd7c680df98c33fa;hp=9104c371e7ecf90fa03e0ebef320d713411909be;hpb=3011d96c08374f215cc300d871e168372eb1859e;p=libfirm diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 9104c371e..0b8c4c64d 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -41,33 +41,6 @@ */ ir_node **get_irn_in(const ir_node *node); -/** - * The amount of additional space for custom data to be allocated upon creating a new node. - */ -extern unsigned firm_add_node_size; - -/** - * Sets the get_type_attr operation for an ir_op_ops. - * - * @param code the opcode for the default operation - * @param ops the operations initialized - * - * @return - * The operations. - */ -void firm_set_default_get_type_attr(unsigned code, ir_op_ops *ops); - -/** - * Sets the get_entity_attr operation for an ir_op_ops. - * - * @param code the opcode for the default operation - * @param ops the operations initialized - * - * @return - * The operations. - */ -void firm_set_default_get_entity_attr(unsigned code, ir_op_ops *ops); - /** * Returns an array with the predecessors of the Block. Depending on * the implementation of the graph data structure this can be a copy of @@ -147,7 +120,7 @@ static inline ir_node *get_irn_n_(const ir_node *node, int n) assert(-1 <= n && n < get_irn_arity_(node)); nn = node->in[n + 1]; - if (nn->op != op_Id) return nn; + if (!is_Id(nn)) return nn; return (node->in[n + 1] = skip_Id(nn)); } @@ -175,18 +148,6 @@ static inline ir_node *get_irn_dep_(const ir_node *node, int pos) /* forward declaration outside iredges_t.h to avoid circular include problems */ void edges_notify_edge_kind(ir_node *src, int pos, ir_node *tgt, ir_node *old_tgt, ir_edge_kind_t kind, ir_graph *irg); -static inline void set_irn_dep_(ir_node *node, int pos, ir_node *dep) -{ - ir_node *old; - - assert(node->deps && "dependency array node yet allocated. use add_irn_dep()"); - assert(pos >= 0 && pos < (int)ARR_LEN(node->deps) && "dependency index out of range"); - old = node->deps[pos]; - node->deps[pos] = dep; - edges_notify_edge_kind(node, pos, dep, old, EDGE_KIND_DEP, get_irn_irg(node)); -} - - static inline int get_irn_ins_or_deps_(const ir_node *irn) { return get_irn_deps_(irn) + get_irn_arity_(irn); @@ -225,13 +186,8 @@ static inline int ir_has_irg_ref(const ir_node *node) static inline ir_graph *get_irn_irg_(const ir_node *node) { - /* - * Do not use get_nodes_block() here, because this - * will check the pinned state. - * However even a 'wrong' block is always in the proper irg. - */ if (! is_Block(node)) - node = get_irn_n(node, -1); + node = get_nodes_block(node); assert(ir_has_irg_ref(node)); return node->attr.irg.irg; } @@ -350,11 +306,6 @@ static inline int is_binop_(const ir_node *node) return (node->op->opar == oparity_binary); } -static inline int is_strictConv_(const ir_node *node) -{ - return is_Conv_(node) && get_Conv_strict(node); -} - static inline int is_SymConst_addr_ent_(const ir_node *node) { return is_SymConst(node) && get_SymConst_kind(node) == symconst_addr_ent; @@ -427,7 +378,7 @@ static inline ir_graph *get_Block_irg_(const ir_node *block) static inline ir_tarval *get_Const_tarval_(const ir_node *node) { - assert(get_irn_op_(node) == op_Const); + assert(is_Const(node)); return node->attr.con.tarval; } @@ -466,11 +417,6 @@ static inline int is_irn_constlike_(const ir_node *node) return is_op_constlike(get_irn_op_(node)); } -static inline int is_irn_always_opt_(const ir_node *node) -{ - return is_op_always_opt(get_irn_op_(node)); -} - static inline int is_irn_keep_(const ir_node *node) { return is_op_keep(get_irn_op_(node)); @@ -488,13 +434,13 @@ static inline int is_irn_cse_neutral_(const ir_node *node) static inline cond_jmp_predicate get_Cond_jmp_pred_(const ir_node *node) { - assert(get_irn_op_(node) == op_Cond); + assert(is_Cond(node)); return node->attr.cond.jmp_pred; } static inline void set_Cond_jmp_pred_(ir_node *node, cond_jmp_predicate pred) { - assert(get_irn_op_(node) == op_Cond); + assert(is_Cond(node)); node->attr.cond.jmp_pred = pred; } @@ -607,8 +553,14 @@ static inline const ir_switch_table_entry *ir_switch_table_get_entry_const( return &table->entries[entry]; } -/** initialize ir_node module */ -void init_irnode(void); +void ir_register_getter_ops(void); + +/** + * because firm keepalive edges are a broken concept, we have to make sure that + * nodes which are only held by a keepalive edges are never moved again. + * This function returns true in this case. + */ +bool only_used_by_keepalive(const ir_node *node); /* this section MUST contain all inline functions */ #define is_ir_node(thing) is_ir_node_(thing) @@ -634,7 +586,6 @@ void init_irnode(void); #define is_binop(node) is_binop_(node) #define is_Proj(node) is_Proj_(node) #define is_Phi(node) is_Phi_(node) -#define is_strictConv(node) is_strictConv_(node) #define is_SymConst_addr_ent(node) is_SymConst_addr_ent_(node) #define get_Block_n_cfgpreds(node) get_Block_n_cfgpreds_(node) #define get_Block_cfgpred(node, pos) get_Block_cfgpred_(node, pos) @@ -654,7 +605,6 @@ void init_irnode(void); #define get_irn_type_attr(node) get_irn_type_attr_(node) #define get_irn_entity_attr(node) get_irn_entity_attr_(node) #define is_irn_constlike(node) is_irn_constlike_(node) -#define is_irn_always_opt(node) is_irn_always_opt_(node) #define is_irn_keep(node) is_irn_keep_(node) #define is_irn_start_block_placed(node) is_irn_start_block_placed_(node) #define is_irn_cse_neutral(node) is_irn_cse_neutral_(node) @@ -665,7 +615,6 @@ void init_irnode(void); #define get_irn_idx(node) get_irn_idx_(node) #define get_irn_deps(node) get_irn_deps_(node) -#define set_irn_dep(node, pos, dep) set_irn_dep_(node, pos, dep) #define get_irn_dep(node, pos) get_irn_dep_(node, pos) #define get_irn_ins_or_deps(node) get_irn_ins_or_deps_(node)