Commit 94f6c873 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove get_XXX_attr type functions

[r27346]
parent a0111be4
...@@ -548,92 +548,6 @@ long get_irn_node_nr(const ir_node *node) ...@@ -548,92 +548,6 @@ long get_irn_node_nr(const ir_node *node)
return node->node_nr; 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) void *(get_irn_generic_attr)(ir_node *node)
{ {
assert(is_ir_node(node)); assert(is_ir_node(node));
......
...@@ -41,24 +41,6 @@ ...@@ -41,24 +41,6 @@
*/ */
ir_node **get_irn_in (const ir_node *node); ir_node **get_irn_in (const ir_node *node);
/** @{ */
/** access attributes directly */
const_attr *get_irn_const_attr (ir_node *node);
long get_irn_proj_attr (ir_node *node);
alloc_attr *get_irn_alloc_attr (ir_node *node);
free_attr *get_irn_free_attr (ir_node *node);
symconst_attr *get_irn_symconst_attr (ir_node *node);
call_attr *get_irn_call_attr (ir_node *node);
sel_attr *get_irn_sel_attr (ir_node *node);
phi_attr *get_irn_phi_attr (ir_node *node);
block_attr *get_irn_block_attr (ir_node *node);
load_attr *get_irn_load_attr (ir_node *node);
store_attr *get_irn_store_attr (ir_node *node);
except_attr *get_irn_except_attr (ir_node *node);
divmod_attr *get_irn_divmod_attr (ir_node *node);
builtin_attr *get_irn_builtin_attr (ir_node *node);
/** @} */
/** /**
* The amount of additional space for custom data to be allocated upon creating a new node. * The amount of additional space for custom data to be allocated upon creating a new node.
*/ */
......
...@@ -6142,7 +6142,7 @@ static int node_cmp_attr_Const(ir_node *a, ir_node *b) ...@@ -6142,7 +6142,7 @@ static int node_cmp_attr_Const(ir_node *a, ir_node *b)
/** Compares the attributes of two Proj nodes. */ /** Compares the attributes of two Proj nodes. */
static int node_cmp_attr_Proj(ir_node *a, ir_node *b) 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 */ } /* node_cmp_attr_Proj */
/** Compares the attributes of two Filter nodes. */ /** Compares the attributes of two Filter nodes. */
...@@ -6154,24 +6154,24 @@ static int node_cmp_attr_Filter(ir_node *a, ir_node *b) ...@@ -6154,24 +6154,24 @@ static int node_cmp_attr_Filter(ir_node *a, ir_node *b)
/** Compares the attributes of two Alloc nodes. */ /** Compares the attributes of two Alloc nodes. */
static int node_cmp_attr_Alloc(ir_node *a, ir_node *b) static int node_cmp_attr_Alloc(ir_node *a, ir_node *b)
{ {
const alloc_attr *pa = get_irn_alloc_attr(a); const alloc_attr *pa = &a->attr.alloc;
const alloc_attr *pb = get_irn_alloc_attr(b); const alloc_attr *pb = &b->attr.alloc;
return (pa->where != pb->where) || (pa->type != pb->type); return (pa->where != pb->where) || (pa->type != pb->type);
} /* node_cmp_attr_Alloc */ } /* node_cmp_attr_Alloc */
/** Compares the attributes of two Free nodes. */ /** Compares the attributes of two Free nodes. */
static int node_cmp_attr_Free(ir_node *a, ir_node *b) static int node_cmp_attr_Free(ir_node *a, ir_node *b)
{ {
const free_attr *pa = get_irn_free_attr(a); const free_attr *pa = &a->attr.free;
const free_attr *pb = get_irn_free_attr(b); const free_attr *pb = &b->attr.free;
return (pa->where != pb->where) || (pa->type != pb->type); return (pa->where != pb->where) || (pa->type != pb->type);
} /* node_cmp_attr_Free */ } /* node_cmp_attr_Free */
/** Compares the attributes of two SymConst nodes. */ /** Compares the attributes of two SymConst nodes. */
static int node_cmp_attr_SymConst(ir_node *a, ir_node *b) static int node_cmp_attr_SymConst(ir_node *a, ir_node *b)
{ {
const symconst_attr *pa = get_irn_symconst_attr(a); const symconst_attr *pa = &a->attr.symc;
const symconst_attr *pb = get_irn_symconst_attr(b); const symconst_attr *pb = &b->attr.symc;
return (pa->kind != pb->kind) return (pa->kind != pb->kind)
|| (pa->sym.type_p != pb->sym.type_p) || (pa->sym.type_p != pb->sym.type_p)
|| (pa->tp != pb->tp); || (pa->tp != pb->tp);
...@@ -6180,8 +6180,8 @@ static int node_cmp_attr_SymConst(ir_node *a, ir_node *b) ...@@ -6180,8 +6180,8 @@ static int node_cmp_attr_SymConst(ir_node *a, ir_node *b)
/** Compares the attributes of two Call nodes. */ /** Compares the attributes of two Call nodes. */
static int node_cmp_attr_Call(ir_node *a, ir_node *b) static int node_cmp_attr_Call(ir_node *a, ir_node *b)
{ {
const call_attr *pa = get_irn_call_attr(a); const call_attr *pa = &a->attr.call;
const call_attr *pb = get_irn_call_attr(b); const call_attr *pb = &b->attr.call;
return (pa->type != pb->type) return (pa->type != pb->type)
|| (pa->tail_call != pb->tail_call); || (pa->tail_call != pb->tail_call);
} /* node_cmp_attr_Call */ } /* node_cmp_attr_Call */
...@@ -6191,16 +6191,6 @@ static int node_cmp_attr_Sel(ir_node *a, ir_node *b) ...@@ -6191,16 +6191,6 @@ static int node_cmp_attr_Sel(ir_node *a, ir_node *b)
{ {
const ir_entity *a_ent = get_Sel_entity(a); const ir_entity *a_ent = get_Sel_entity(a);
const ir_entity *b_ent = get_Sel_entity(b); 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; return a_ent != b_ent;
} /* node_cmp_attr_Sel */ } /* node_cmp_attr_Sel */
...@@ -6211,7 +6201,7 @@ static int node_cmp_attr_Phi(ir_node *a, ir_node *b) ...@@ -6211,7 +6201,7 @@ static int node_cmp_attr_Phi(ir_node *a, ir_node *b)
hence it is enough to check if one of them is a Phi0 */ hence it is enough to check if one of them is a Phi0 */
if (is_Phi0(a)) { if (is_Phi0(a)) {
/* check the Phi0 pos attribute */ /* 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; return 0;
} /* node_cmp_attr_Phi */ } /* node_cmp_attr_Phi */
...@@ -6257,8 +6247,8 @@ static int node_cmp_attr_Store(ir_node *a, ir_node *b) ...@@ -6257,8 +6247,8 @@ static int node_cmp_attr_Store(ir_node *a, ir_node *b)
/** Compares two exception attributes */ /** Compares two exception attributes */
static int node_cmp_exception(ir_node *a, ir_node *b) static int node_cmp_exception(ir_node *a, ir_node *b)
{ {
const except_attr *ea = get_irn_except_attr(a); const except_attr *ea = &a->attr.except;
const except_attr *eb = get_irn_except_attr(b); const except_attr *eb = &b->attr.except;
return ea->pin_state != eb->pin_state; return ea->pin_state != eb->pin_state;
} }
...@@ -6268,8 +6258,8 @@ static int node_cmp_exception(ir_node *a, ir_node *b) ...@@ -6268,8 +6258,8 @@ static int node_cmp_exception(ir_node *a, ir_node *b)
/** Compares the attributes of two Div nodes. */ /** Compares the attributes of two Div nodes. */
static int node_cmp_attr_Div(ir_node *a, ir_node *b) static int node_cmp_attr_Div(ir_node *a, ir_node *b)
{ {
const divmod_attr *ma = get_irn_divmod_attr(a); const divmod_attr *ma = &a->attr.divmod;
const divmod_attr *mb = get_irn_divmod_attr(b); const divmod_attr *mb = &b->attr.divmod;
return ma->exc.pin_state != mb->exc.pin_state || return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode || ma->resmode != mb->resmode ||
ma->no_remainder != mb->no_remainder; ma->no_remainder != mb->no_remainder;
...@@ -6278,8 +6268,8 @@ static int node_cmp_attr_Div(ir_node *a, ir_node *b) ...@@ -6278,8 +6268,8 @@ static int node_cmp_attr_Div(ir_node *a, ir_node *b)
/** Compares the attributes of two DivMod nodes. */ /** Compares the attributes of two DivMod nodes. */
static int node_cmp_attr_DivMod(ir_node *a, ir_node *b) static int node_cmp_attr_DivMod(ir_node *a, ir_node *b)
{ {
const divmod_attr *ma = get_irn_divmod_attr(a); const divmod_attr *ma = &a->attr.divmod;
const divmod_attr *mb = get_irn_divmod_attr(b); const divmod_attr *mb = &b->attr.divmod;
return ma->exc.pin_state != mb->exc.pin_state || return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode; ma->resmode != mb->resmode;
} /* node_cmp_attr_DivMod */ } /* node_cmp_attr_DivMod */
...@@ -6287,19 +6277,13 @@ static int node_cmp_attr_DivMod(ir_node *a, ir_node *b) ...@@ -6287,19 +6277,13 @@ static int node_cmp_attr_DivMod(ir_node *a, ir_node *b)
/** Compares the attributes of two Mod nodes. */ /** Compares the attributes of two Mod nodes. */
static int node_cmp_attr_Mod(ir_node *a, ir_node *b) static int node_cmp_attr_Mod(ir_node *a, ir_node *b)
{ {
const divmod_attr *ma = get_irn_divmod_attr(a); return node_cmp_attr_DivMod(a, b);
const divmod_attr *mb = get_irn_divmod_attr(b);
return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode;
} /* node_cmp_attr_Mod */ } /* node_cmp_attr_Mod */
/** Compares the attributes of two Quot nodes. */ /** Compares the attributes of two Quot nodes. */
static int node_cmp_attr_Quot(ir_node *a, ir_node *b) static int node_cmp_attr_Quot(ir_node *a, ir_node *b)
{ {
const divmod_attr *ma = get_irn_divmod_attr(a); return node_cmp_attr_DivMod(a, b);
const divmod_attr *mb = get_irn_divmod_attr(b);
return ma->exc.pin_state != mb->exc.pin_state ||
ma->resmode != mb->resmode;
} /* node_cmp_attr_Quot */ } /* node_cmp_attr_Quot */
/** Compares the attributes of two Confirm nodes. */ /** Compares the attributes of two Confirm nodes. */
...@@ -6312,11 +6296,8 @@ static int node_cmp_attr_Confirm(ir_node *a, ir_node *b) ...@@ -6312,11 +6296,8 @@ static int node_cmp_attr_Confirm(ir_node *a, ir_node *b)
/** Compares the attributes of two Builtin nodes. */ /** Compares the attributes of two Builtin nodes. */
static int node_cmp_attr_Builtin(ir_node *a, ir_node *b) 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 */ /* 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 */ } /* node_cmp_attr_Builtin */
/** Compares the attributes of two ASM nodes. */ /** Compares the attributes of two ASM nodes. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment