projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[libfirm]
/
ir
/
opt
/
return.c
diff --git
a/ir/opt/return.c
b/ir/opt/return.c
index
55bde8a
..
7fac730
100644
(file)
--- a/
ir/opt/return.c
+++ b/
ir/opt/return.c
@@
-58,7
+58,8
@@
* res = c;
* return res;
*/
* res = c;
* return res;
*/
-void normalize_one_return(ir_graph *irg) {
+void normalize_one_return(ir_graph *irg)
+{
ir_node *endbl = get_irg_end_block(irg);
int i, j, k, n, last_idx, n_rets, n_ret_vals = -1;
unsigned char *returns;
ir_node *endbl = get_irg_end_block(irg);
int i, j, k, n, last_idx, n_rets, n_ret_vals = -1;
unsigned char *returns;
@@
-162,9
+163,7
@@
void normalize_one_return(ir_graph *irg) {
* trouts and callee-state should be still valid
*/
set_irg_doms_inconsistent(irg);
* trouts and callee-state should be still valid
*/
set_irg_doms_inconsistent(irg);
- set_irg_outs_inconsistent(irg);
set_irg_extblk_inconsistent(irg);
set_irg_extblk_inconsistent(irg);
- set_irg_loopinfo_inconsistent(irg);
}
/* Create a graph pass. */
}
/* Create a graph pass. */
@@
-180,7
+179,7
@@
ir_graph_pass_t *normalize_one_return_pass(const char *name)
* with the Return, otherwise they are dead (because the Return leaves
* the graph, so no more users of the other nodes can exists.
*
* with the Return, otherwise they are dead (because the Return leaves
* the graph, so no more users of the other nodes can exists.
*
- * We can move a Return, if it
'
s predecessors are Phi nodes or
+ * We can move a Return, if its predecessors are Phi nodes or
* comes from another block. In the later case, it is always possible
* to move the Return one block up, because the predecessor block must
* dominate the Return block (SSA) and then it dominates the predecessor
* comes from another block. In the later case, it is always possible
* to move the Return one block up, because the predecessor block must
* dominate the Return block (SSA) and then it dominates the predecessor
@@
-189,7
+188,8
@@
ir_graph_pass_t *normalize_one_return_pass(const char *name)
* All predecessors of the Return block must be Jmp's of course, or we
* cannot move it up, so we add blocks if needed.
*/
* All predecessors of the Return block must be Jmp's of course, or we
* cannot move it up, so we add blocks if needed.
*/
-static int can_move_ret(ir_node *ret) {
+static int can_move_ret(ir_node *ret)
+{
ir_node *retbl = get_nodes_block(ret);
int i, n = get_irn_arity(ret);
ir_node *retbl = get_nodes_block(ret);
int i, n = get_irn_arity(ret);
@@
-243,7
+243,8
@@
static int can_move_ret(ir_node *ret) {
* else
* return c;
*/
* else
* return c;
*/
-void normalize_n_returns(ir_graph *irg) {
+void normalize_n_returns(ir_graph *irg)
+{
int i, j, n, n_rets, n_finals, n_ret_vals;
ir_node *list = NULL;
ir_node *final = NULL;
int i, j, n, n_rets, n_finals, n_ret_vals;
ir_node *list = NULL;
ir_node *final = NULL;
@@
-294,7
+295,7
@@
void normalize_n_returns(ir_graph *irg) {
dbg_info *dbgi = get_irn_dbg_info(ret);
ir_node *phiM;
dbg_info *dbgi = get_irn_dbg_info(ret);
ir_node *phiM;
- list = get_irn_link(ret);
+ list =
(ir_node*)
get_irn_link(ret);
--n_rets;
n = get_Block_n_cfgpreds(block);
--n_rets;
n = get_Block_n_cfgpreds(block);
@@
-337,7
+338,7
@@
void normalize_n_returns(ir_graph *irg) {
}
/* remove the Jmp, we have placed a Return here */
}
/* remove the Jmp, we have placed a Return here */
- exchange(jmp, new_r_Bad(irg));
+ exchange(jmp, new_r_Bad(irg
, mode_X
));
}
/*
}
/*
@@
-350,7
+351,7
@@
void normalize_n_returns(ir_graph *irg) {
n = get_End_n_keepalives(end);
for (i = 0; i < n; ++i) {
if (get_End_keepalive(end, i) == phiM) {
n = get_End_n_keepalives(end);
for (i = 0; i < n; ++i) {
if (get_End_keepalive(end, i) == phiM) {
- set_End_keepalive(end, i, new_r_Bad(irg));
+ set_End_keepalive(end, i, new_r_Bad(irg
, mode_M
));
break;
}
}
break;
}
}
@@
-363,7
+364,7
@@
void normalize_n_returns(ir_graph *irg) {
*/
in = ALLOCAN(ir_node*, n_finals);
*/
in = ALLOCAN(ir_node*, n_finals);
- for (i = 0; final
; ++i, final =
get_irn_link(final))
+ for (i = 0; final
!= NULL; ++i, final = (ir_node*)
get_irn_link(final))
in[i] = final;
exchange(endbl, new_r_Block(irg, n_finals, in));
in[i] = final;
exchange(endbl, new_r_Block(irg, n_finals, in));
@@
-377,8
+378,6
@@
void normalize_n_returns(ir_graph *irg) {
*/
set_irg_doms_inconsistent(irg);
set_irg_extblk_inconsistent(irg); /* may not be needed */
*/
set_irg_doms_inconsistent(irg);
set_irg_extblk_inconsistent(irg); /* may not be needed */
- set_irg_outs_inconsistent(irg);
- set_irg_loopinfo_inconsistent(current_ir_graph);
}
/* Create a graph pass. */
}
/* Create a graph pass. */