beinsn: Do not store, whether insn operands are constrained.
[libfirm] / ir / be / beinfo.c
index 10ba2e1..05f1b95 100644 (file)
 /**
  * @file
  * @author      Matthias Braun
- * @version     $Id$
  */
 #include "config.h"
 
 #include <stdbool.h>
 
 #include "beinfo.h"
+#include "beirg.h"
 #include "bearch.h"
 #include "benode.h"
 #include "besched.h"
@@ -37,7 +37,7 @@
 
 static copy_attr_func old_phi_copy_attr;
 
-void be_info_new_node(ir_node *node)
+void be_info_new_node(ir_graph *irg, ir_node *node)
 {
        struct obstack *obst;
        backend_info_t *info;
@@ -46,7 +46,7 @@ void be_info_new_node(ir_node *node)
        if (is_Proj(node))
                return;
 
-       obst = be_get_be_obst(current_ir_graph);
+       obst = be_get_be_obst(irg);
        info = OALLOCZ(obst, backend_info_t);
 
        assert(node->backend_info == NULL);
@@ -125,8 +125,9 @@ int be_nodes_equal(const ir_node *node1, const ir_node *node2)
 
 static void init_walker(ir_node *node, void *data)
 {
+       ir_graph *irg = get_irn_irg(node);
        (void) data;
-       be_info_new_node(node);
+       be_info_new_node(irg, node);
 }
 
 static bool initialized = false;
@@ -148,20 +149,20 @@ void be_info_init(void)
 /**
  * Edge hook to dump the schedule edges.
  */
-static void sched_edge_hook(FILE *F, ir_node *irn)
+static void sched_edge_hook(FILE *F, const ir_node *irn)
 {
-       if (is_Proj(irn))
-               return;
        if (get_irn_irg(irn)->be_data == NULL)
                return;
 
-       if (sched_is_scheduled(irn) && sched_has_prev(irn)) {
-               ir_node *prev = sched_prev(irn);
-               fprintf(F, "edge:{sourcename:\"");
-               PRINT_NODEID(irn);
-               fprintf(F, "\" targetname:\"");
-               PRINT_NODEID(prev);
-               fprintf(F, "\" color:magenta}\n");
+       if (sched_is_scheduled(irn) && !is_Block(irn)) {
+               ir_node *const prev = sched_prev(irn);
+               if (!sched_is_begin(prev)) {
+                       fprintf(F, "edge:{sourcename: ");
+                       print_nodeid(F, irn);
+                       fprintf(F, " targetname: ");
+                       print_nodeid(F, prev);
+                       fprintf(F, " color:magenta}\n");
+               }
        }
 }
 
@@ -175,7 +176,7 @@ void be_info_init_irg(ir_graph *irg)
 void be_info_free(void)
 {
        if (!initialized)
-               panic("be_info_free called without prior init");
+               panic("called without prior init");
 
        assert(op_Phi->ops.copy_attr == new_phi_copy_attr);
        op_Phi->ops.copy_attr = old_phi_copy_attr;
@@ -184,9 +185,3 @@ void be_info_free(void)
        assert(op_Phi->ops.dump_node == be_dump_phi_reg_reqs);
        op_Phi->ops.dump_node = NULL;
 }
-
-int be_info_initialized(const ir_graph *irg)
-{
-       (void) irg;
-       return initialized;
-}