Commit d9b6d096 authored by Matthias Braun's avatar Matthias Braun
Browse files

const changes and enhancements to irouts

[r20596]
parent 1a49aa9c
...@@ -219,6 +219,6 @@ void free_all_loop_information (void); ...@@ -219,6 +219,6 @@ void free_all_loop_information (void);
* *
* Returns non-zero, if the node n is not changed in the loop block * Returns non-zero, if the node n is not changed in the loop block
* belongs to or in inner loops of this block. */ * belongs to or in inner loops of this block. */
int is_loop_invariant(ir_node *n, ir_node *block); int is_loop_invariant(const ir_node *n, const ir_node *block);
#endif #endif
...@@ -75,6 +75,13 @@ void irg_out_block_walk(ir_node *node, ...@@ -75,6 +75,13 @@ void irg_out_block_walk(ir_node *node,
irg_walk_func *pre, irg_walk_func *post, irg_walk_func *pre, irg_walk_func *post,
void *env); void *env);
/**
* returns 1 if outs have been computed for a node, 0 otherwise.
*
* this is usefull to detect newly created nodes that have no outs set yet
*/
int get_irn_outs_computed(const ir_node *node);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* Building and Removing the out datastructure */ /* Building and Removing the out datastructure */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
......
...@@ -59,6 +59,11 @@ static void reset_outs(ir_node *node, void *unused) { ...@@ -59,6 +59,11 @@ static void reset_outs(ir_node *node, void *unused) {
} }
#endif #endif
int get_irn_outs_computed(const ir_node *node)
{
return node->out != NULL;
}
/* returns the number of successors of the node: */ /* returns the number of successors of the node: */
int get_irn_n_outs(ir_node *node) { int get_irn_n_outs(ir_node *node) {
assert(node && node->kind == k_ir_node); assert(node && node->kind == k_ir_node);
......
...@@ -1248,8 +1248,8 @@ int is_loop_variant(ir_loop *l, ir_loop *b) { ...@@ -1248,8 +1248,8 @@ int is_loop_variant(ir_loop *l, ir_loop *b) {
* *
* Returns non-zero, if the node n is not changed in the loop block * Returns non-zero, if the node n is not changed in the loop block
* belongs to or in inner loops of this blocks loop. */ * belongs to or in inner loops of this blocks loop. */
int is_loop_invariant(ir_node *n, ir_node *block) { int is_loop_invariant(const ir_node *n, const ir_node *block) {
ir_loop *l = get_irn_loop(block); ir_loop *l = get_irn_loop(block);
ir_node *b = is_Block(n) ? n : get_nodes_block(n); const ir_node *b = is_Block(n) ? n : get_nodes_block(n);
return !is_loop_variant(l, get_irn_loop(b)); return !is_loop_variant(l, get_irn_loop(b));
} }
Supports Markdown
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