projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
panic() instead of assert(0).
[libfirm]
/
ir
/
opt
/
tailrec.c
diff --git
a/ir/opt/tailrec.c
b/ir/opt/tailrec.c
index
11e9088
..
45f1b50
100644
(file)
--- a/
ir/opt/tailrec.c
+++ b/
ir/opt/tailrec.c
@@
-78,7
+78,7
@@
static void collect_data(ir_node *node, void *env) {
if (op == op_Proj) {
ir_node *start = get_Proj_pred(pred);
if (op == op_Proj) {
ir_node *start = get_Proj_pred(pred);
- if (
get_irn_op(start) == op_Start
) {
+ if (
is_Start(start)
) {
if (get_Proj_proj(pred) == pn_Start_T_args) {
/* found Proj(ProjT(Start)) */
set_irn_link(node, data->proj_data);
if (get_Proj_proj(pred) == pn_Start_T_args) {
/* found Proj(ProjT(Start)) */
set_irn_link(node, data->proj_data);
@@
-489,7
+489,7
@@
static tail_rec_variants find_variant(ir_node *irn, ir_node *call) {
return TR_BAD;
case iro_Sub:
return TR_BAD;
case iro_Sub:
- /* try additive, but return value mut be left */
+ /* try additive, but return value mu
s
t be left */
a = get_Sub_left(irn);
if (get_irn_MacroBlock(a) != get_irn_MacroBlock(call)) {
/* we are outside, ignore */
a = get_Sub_left(irn);
if (get_irn_MacroBlock(a) != get_irn_MacroBlock(call)) {
/* we are outside, ignore */
@@
-719,8
+719,11
@@
void opt_tail_recursion(void) {
current_ir_graph = irg;
current_ir_graph = irg;
+ ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
if (opt_tail_rec_irg(irg))
++n_opt_applications;
if (opt_tail_rec_irg(irg))
++n_opt_applications;
+
+ ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
}
DB((dbg, LEVEL_1, "Performed tail recursion for %d of %d graphs\n",
}
DB((dbg, LEVEL_1, "Performed tail recursion for %d of %d graphs\n",