return node->node_nr;
}
-const_attr *get_irn_const_attr(ir_node *node)
-{
- assert(is_Const(node));
- return &node->attr.con;
-}
-
-long get_irn_proj_attr(ir_node *node)
-{
- /* BEWARE: check for true Proj node here, no Filter */
- assert(node->op == op_Proj);
- return node->attr.proj;
-}
-
-alloc_attr *get_irn_alloc_attr(ir_node *node)
-{
- assert(is_Alloc(node));
- return &node->attr.alloc;
-}
-
-free_attr *get_irn_free_attr(ir_node *node)
-{
- assert(is_Free(node));
- return &node->attr.free;
-}
-
-symconst_attr *get_irn_symconst_attr(ir_node *node)
-{
- assert(is_SymConst(node));
- return &node->attr.symc;
-}
-
-call_attr *get_irn_call_attr(ir_node *node)
-{
- assert(is_Call(node));
- return &node->attr.call;
-}
-
-sel_attr *get_irn_sel_attr(ir_node *node)
-{
- assert(is_Sel(node));
- return &node->attr.sel;
-}
-
-phi_attr *get_irn_phi_attr(ir_node *node)
-{
- return &node->attr.phi;
-}
-
-block_attr *get_irn_block_attr(ir_node *node)
-{
- assert(is_Block(node));
- return &node->attr.block;
-}
-
-load_attr *get_irn_load_attr(ir_node *node)
-{
- assert(is_Load(node));
- return &node->attr.load;
-}
-
-store_attr *get_irn_store_attr(ir_node *node)
-{
- assert(is_Store(node));
- return &node->attr.store;
-}
-
-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 || node->op == op_Bound);
- return &node->attr.except;
-}
-
-divmod_attr *get_irn_divmod_attr(ir_node *node)
-{
- assert(node->op == op_Div || node->op == op_Quot ||
- node->op == op_DivMod || node->op == op_Mod);
- return &node->attr.divmod;
-}
-
-builtin_attr *get_irn_builtin_attr(ir_node *node)
-{
- assert(is_Builtin(node));
- return &node->attr.builtin;
-}
-
void *(get_irn_generic_attr)(ir_node *node)
{
assert(is_ir_node(node));
/** Compares the attributes of two Proj nodes. */
static int node_cmp_attr_Proj(ir_node *a, ir_node *b)
{
- return get_irn_proj_attr(a) != get_irn_proj_attr(b);
+ return a->attr.proj != b->attr.proj;
} /* node_cmp_attr_Proj */
/** Compares the attributes of two Filter nodes. */
/** Compares the attributes of two Alloc nodes. */
static int node_cmp_attr_Alloc(ir_node *a, ir_node *b)
{
- const alloc_attr *pa = get_irn_alloc_attr(a);
- const alloc_attr *pb = get_irn_alloc_attr(b);
+ const alloc_attr *pa = &a->attr.alloc;
+ const alloc_attr *pb = &b->attr.alloc;
return (pa->where != pb->where) || (pa->type != pb->type);
} /* node_cmp_attr_Alloc */
/** Compares the attributes of two Free nodes. */
static int node_cmp_attr_Free(ir_node *a, ir_node *b)
{
- const free_attr *pa = get_irn_free_attr(a);
- const free_attr *pb = get_irn_free_attr(b);
+ const free_attr *pa = &a->attr.free;
+ const free_attr *pb = &b->attr.free;
return (pa->where != pb->where) || (pa->type != pb->type);
} /* node_cmp_attr_Free */
/** Compares the attributes of two SymConst nodes. */
static int node_cmp_attr_SymConst(ir_node *a, ir_node *b)
{
- const symconst_attr *pa = get_irn_symconst_attr(a);
- const symconst_attr *pb = get_irn_symconst_attr(b);
+ const symconst_attr *pa = &a->attr.symc;
+ const symconst_attr *pb = &b->attr.symc;
return (pa->kind != pb->kind)
|| (pa->sym.type_p != pb->sym.type_p)
|| (pa->tp != pb->tp);
/** Compares the attributes of two Call nodes. */
static int node_cmp_attr_Call(ir_node *a, ir_node *b)
{
- const call_attr *pa = get_irn_call_attr(a);
- const call_attr *pb = get_irn_call_attr(b);
+ const call_attr *pa = &a->attr.call;
+ const call_attr *pb = &b->attr.call;
return (pa->type != pb->type)
|| (pa->tail_call != pb->tail_call);
} /* node_cmp_attr_Call */
{
const ir_entity *a_ent = get_Sel_entity(a);
const ir_entity *b_ent = get_Sel_entity(b);
-#if 0
- return
- (a_ent->kind != b_ent->kind) ||
- (a_ent->name != b_ent->name) ||
- (a_ent->owner != b_ent->owner) ||
- (a_ent->ld_name != b_ent->ld_name) ||
- (a_ent->type != b_ent->type);
-#endif
- /* Matze: inlining of functions can produce 2 entities with same type,
- * name, etc. */
return a_ent != b_ent;
} /* node_cmp_attr_Sel */
hence it is enough to check if one of them is a Phi0 */
if (is_Phi0(a)) {
/* check the Phi0 pos attribute */
- return get_irn_phi_attr(a)->u.pos != get_irn_phi_attr(b)->u.pos;
+ return a->attr.phi.u.pos != b->attr.phi.u.pos;
}
return 0;
} /* node_cmp_attr_Phi */
/** Compares two exception attributes */
static int node_cmp_exception(ir_node *a, ir_node *b)
{
- const except_attr *ea = get_irn_except_attr(a);
- const except_attr *eb = get_irn_except_attr(b);
+ const except_attr *ea = &a->attr.except;
+ const except_attr *eb = &b->attr.except;
return ea->pin_state != eb->pin_state;
}
/** Compares the attributes of two Div nodes. */
static int node_cmp_attr_Div(ir_node *a, ir_node *b)
{
- const divmod_attr *ma = get_irn_divmod_attr(a);
- const divmod_attr *mb = get_irn_divmod_attr(b);
+ const divmod_attr *ma = &a->attr.divmod;
+ const divmod_attr *mb = &b->attr.divmod;
return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode ||
ma->no_remainder != mb->no_remainder;
/** Compares the attributes of two DivMod nodes. */
static int node_cmp_attr_DivMod(ir_node *a, ir_node *b)
{
- const divmod_attr *ma = get_irn_divmod_attr(a);
- const divmod_attr *mb = get_irn_divmod_attr(b);
+ const divmod_attr *ma = &a->attr.divmod;
+ const divmod_attr *mb = &b->attr.divmod;
return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode;
} /* node_cmp_attr_DivMod */
/** Compares the attributes of two Mod nodes. */
static int node_cmp_attr_Mod(ir_node *a, ir_node *b)
{
- const divmod_attr *ma = get_irn_divmod_attr(a);
- const divmod_attr *mb = get_irn_divmod_attr(b);
- return ma->exc.pin_state != mb->exc.pin_state ||
- ma->resmode != mb->resmode;
+ return node_cmp_attr_DivMod(a, b);
} /* node_cmp_attr_Mod */
/** Compares the attributes of two Quot nodes. */
static int node_cmp_attr_Quot(ir_node *a, ir_node *b)
{
- const divmod_attr *ma = get_irn_divmod_attr(a);
- const divmod_attr *mb = get_irn_divmod_attr(b);
- return ma->exc.pin_state != mb->exc.pin_state ||
- ma->resmode != mb->resmode;
+ return node_cmp_attr_DivMod(a, b);
} /* node_cmp_attr_Quot */
/** Compares the attributes of two Confirm nodes. */
/** Compares the attributes of two Builtin nodes. */
static int node_cmp_attr_Builtin(ir_node *a, ir_node *b)
{
- const builtin_attr *ma = get_irn_builtin_attr(a);
- const builtin_attr *mb = get_irn_builtin_attr(b);
-
/* no need to compare the type, equal kind means equal type */
- return ma->kind != mb->kind;
+ return get_Builtin_kind(a) != get_Builtin_kind(b);
} /* node_cmp_attr_Builtin */
/** Compares the attributes of two ASM nodes. */