Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
94f6c873
Commit
94f6c873
authored
Apr 06, 2010
by
Matthias Braun
Browse files
remove get_XXX_attr type functions
[r27346]
parent
a0111be4
Changes
3
Show whitespace changes
Inline
Side-by-side
ir/ir/irnode.c
View file @
94f6c873
...
...
@@ -548,92 +548,6 @@ long get_irn_node_nr(const ir_node *node)
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
));
...
...
ir/ir/irnode_t.h
View file @
94f6c873
...
...
@@ -41,24 +41,6 @@
*/
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.
*/
...
...
ir/ir/iropt.c
View file @
94f6c873
...
...
@@ -6142,7 +6142,7 @@ static int node_cmp_attr_Const(ir_node *a, ir_node *b)
/** 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. */
...
...
@@ -6154,24 +6154,24 @@ static int node_cmp_attr_Filter(ir_node *a, ir_node *b)
/** 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
);
...
...
@@ -6180,8 +6180,8 @@ static int node_cmp_attr_SymConst(ir_node *a, ir_node *b)
/** 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 */
...
...
@@ -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
*
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 */
...
...
@@ -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 */
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 */
...
...
@@ -6257,8 +6247,8 @@ static int node_cmp_attr_Store(ir_node *a, ir_node *b)
/** 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
;
}
...
...
@@ -6268,8 +6258,8 @@ static int node_cmp_exception(ir_node *a, ir_node *b)
/** 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
;
...
...
@@ -6278,8 +6268,8 @@ static int node_cmp_attr_Div(ir_node *a, ir_node *b)
/** 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 */
...
...
@@ -6287,19 +6277,13 @@ static int node_cmp_attr_DivMod(ir_node *a, ir_node *b)
/** 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. */
...
...
@@ -6312,11 +6296,8 @@ static int node_cmp_attr_Confirm(ir_node *a, ir_node *b)
/** 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. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment