use is_$KIND(n) instead of get_irn_op(n) == op_$KIND.
[libfirm] / ir / ir / irnode_t.h
index 80474c9..c32ad54 100644 (file)
@@ -46,28 +46,6 @@ ir_node **get_irn_in(const ir_node *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.
- */
-ir_op_ops *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.
- */
-ir_op_ops *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 +125,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 +153,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 +191,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;
 }
@@ -427,7 +388,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 +427,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));
@@ -481,21 +437,6 @@ static inline int is_irn_start_block_placed_(const ir_node *node)
        return is_op_start_block_placed(get_irn_op_(node));
 }
 
-static inline int is_irn_machine_op_(const ir_node *node)
-{
-       return is_op_machine(get_irn_op_(node));
-}
-
-static inline int is_irn_machine_operand_(const ir_node *node)
-{
-       return is_op_machine_operand(get_irn_op_(node));
-}
-
-static inline int is_irn_machine_user_(const ir_node *node, unsigned n)
-{
-       return is_op_machine_user(get_irn_op_(node), n);
-}
-
 static inline int is_irn_cse_neutral_(const ir_node *node)
 {
        return is_op_cse_neutral(get_irn_op_(node));
@@ -503,13 +444,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;
 }
 
@@ -622,6 +563,8 @@ static inline const ir_switch_table_entry *ir_switch_table_get_entry_const(
        return &table->entries[entry];
 }
 
+void ir_register_getter_ops(void);
+
 /** initialize ir_node module */
 void init_irnode(void);
 
@@ -669,12 +612,8 @@ 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_machine_op(node)               is_irn_machine_op_(node)
-#define is_irn_machine_operand(node)          is_irn_machine_operand_(node)
-#define is_irn_machine_user(node, n)          is_irn_machine_user_(node, n)
 #define is_irn_cse_neutral(node)              is_irn_cse_neutral_(node)
 #define get_Cond_jmp_pred(node)               get_Cond_jmp_pred_(node)
 #define set_Cond_jmp_pred(node, pred)         set_Cond_jmp_pred_(node, pred)
@@ -683,7 +622,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)