*
* Returns non-zero, if the node n is not changed in the loop 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
irg_walk_func *pre, irg_walk_func *post,
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 */
/*------------------------------------------------------------------*/
}
#endif
+int get_irn_outs_computed(const ir_node *node)
+{
+ return node->out != NULL;
+}
+
/* returns the number of successors of the node: */
int get_irn_n_outs(ir_node *node) {
assert(node && node->kind == k_ir_node);
*
* Returns non-zero, if the node n is not changed in the loop block
* 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_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));
}