const changes and enhancements to irouts
authorMatthias Braun <matze@braunis.de>
Tue, 22 Jul 2008 12:32:11 +0000 (12:32 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 22 Jul 2008 12:32:11 +0000 (12:32 +0000)
[r20596]

include/libfirm/irloop.h
include/libfirm/irouts.h
ir/ana/irouts.c
ir/ana/irscc.c

index 6bfc4cc..c7219b5 100644 (file)
@@ -219,6 +219,6 @@ void free_all_loop_information (void);
  *
  * 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
index 8010891..a574a3b 100644 (file)
@@ -75,6 +75,13 @@ void irg_out_block_walk(ir_node *node,
                         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                      */
 /*------------------------------------------------------------------*/
index 92a5755..2b6ecdd 100644 (file)
@@ -59,6 +59,11 @@ static void reset_outs(ir_node *node, void *unused) {
 }
 #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);
index 4494289..e474878 100644 (file)
@@ -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
  * 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));
 }