Commit aec2064a authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Simplify: if (!irn_visited(x)) { mark_irn_visited(x); ... } -> if...

Simplify: if (!irn_visited(x)) { mark_irn_visited(x); ... }  ->  if (!irn_visited_else_mark(x)) { ... }.
parent 70cfa879
......@@ -285,13 +285,11 @@ static ir_node *get_r_value_internal(ir_node *block, int pos, ir_mode *mode)
return res;
/* We ran into a cycle. This may happen in unreachable loops. */
if (irn_visited(block)) {
if (irn_visited_else_mark(block)) {
/* Since the loop is unreachable, return a Bad. */
return new_r_Bad(irg);
}
mark_irn_visited(block);
/* in a matured block we can immediately determine the phi arguments */
if (get_Block_matured(block)) {
int arity = get_irn_arity(block);
......@@ -598,9 +596,8 @@ static ir_mode *guess_recursively(ir_node *block, int pos)
int n_preds;
int i;
if (irn_visited(block))
if (irn_visited_else_mark(block))
return NULL;
mark_irn_visited(block);
/* already have a defintion -> we can simply look at its mode */
value = block->attr.block.graph_arr[pos];
......
......@@ -1191,8 +1191,7 @@ static void dump_const_node_local(FILE *F, ir_node *n)
for (i = 0; i < get_irn_arity(n); i++) {
ir_node *con = get_irn_n(n, i);
if (is_constlike_node(con) && !irn_visited(con)) {
mark_irn_visited(con);
if (is_constlike_node(con) && !irn_visited_else_mark(con)) {
/* Generate a new name for the node by appending the names of
n and const. */
fprintf(F, "node: {title: "); PRINT_CONSTID(n, con);
......
......@@ -1005,9 +1005,8 @@ static void irg_walk_edges2(ir_node *node, irg_walk_func *pre,
{
const ir_edge_t *edge, *next;
if (irn_visited(node))
if (irn_visited_else_mark(node))
return;
mark_irn_visited(node);
if (pre != NULL)
pre(node, env);
......
......@@ -2213,9 +2213,8 @@ static void lower_node(lower_env_t *env, ir_node *node)
unsigned idx;
node_entry_t *entry;
if (irn_visited(node))
if (irn_visited_else_mark(node))
return;
mark_irn_visited(node);
/* cycles are always broken at Phi and Block nodes. So we don't need special
* magic in all the other lower functions */
......
Markdown is supported
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