Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
7ceddc8e
Commit
7ceddc8e
authored
Aug 29, 2015
by
Christoph Mallon
Browse files
be: Use get_out_info_n().
Now the pos for fetching an out info is checked in all cases.
parent
369eafd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/be/bearch.c
View file @
7ceddc8e
...
...
@@ -62,14 +62,6 @@ arch_register_req_t const arch_no_requirement = {
.
cls
=
&
arch_none_cls
,
};
static
reg_out_info_t
*
get_out_info_n
(
const
ir_node
*
node
,
unsigned
pos
)
{
const
backend_info_t
*
info
=
be_get_info
(
node
);
assert
(
pos
<
(
unsigned
)
ARR_LEN
(
info
->
out_infos
));
return
&
info
->
out_infos
[
pos
];
}
const
arch_register_t
*
arch_get_irn_register
(
const
ir_node
*
node
)
{
const
reg_out_info_t
*
out
=
get_out_info
(
node
);
...
...
ir/be/bearch.h
View file @
7ceddc8e
...
...
@@ -29,6 +29,13 @@ extern arch_register_req_t const arch_memory_requirement;
extern
arch_register_req_t
const
arch_no_requirement
;
#define arch_no_register_req (&arch_no_requirement)
static
inline
reg_out_info_t
*
get_out_info_n
(
ir_node
const
*
const
node
,
unsigned
const
pos
)
{
backend_info_t
const
*
const
info
=
be_get_info
(
node
);
assert
(
pos
<
ARR_LEN
(
info
->
out_infos
));
return
&
info
->
out_infos
[
pos
];
}
/**
* Get the register allocated for a value.
*/
...
...
@@ -63,16 +70,15 @@ static inline const arch_register_req_t *arch_get_irn_register_req_in(
static
inline
const
arch_register_req_t
*
arch_get_irn_register_req_out
(
const
ir_node
*
node
,
unsigned
pos
)
{
const
backend_info_t
*
info
=
be_ge
t_info
(
node
);
return
info
->
out_infos
[
pos
].
req
;
reg_out_info_t
const
*
const
out
=
get_ou
t_info
_n
(
node
,
pos
);
return
out
->
req
;
}
static
inline
void
arch_set_irn_register_req_out
(
ir_node
*
node
,
unsigned
pos
,
const
arch_register_req_t
*
req
)
{
backend_info_t
*
info
=
be_get_info
(
node
);
assert
(
pos
<
(
unsigned
)
ARR_LEN
(
info
->
out_infos
));
info
->
out_infos
[
pos
].
req
=
req
;
reg_out_info_t
*
const
out
=
get_out_info_n
(
node
,
pos
);
out
->
req
=
req
;
}
static
inline
void
arch_set_irn_register_reqs_in
(
ir_node
*
node
,
...
...
@@ -98,9 +104,7 @@ static inline reg_out_info_t *get_out_info(const ir_node *node)
node
=
get_Proj_pred
(
node
);
}
const
backend_info_t
*
info
=
be_get_info
(
node
);
assert
(
pos
<
ARR_LEN
(
info
->
out_infos
));
return
&
info
->
out_infos
[
pos
];
return
get_out_info_n
(
node
,
pos
);
}
static
inline
const
arch_register_req_t
*
arch_get_irn_register_req
(
const
ir_node
*
node
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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