beinfo: assert() that be_get_info() is not called on Projs.
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 26 Nov 2012 21:22:00 +0000 (22:22 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 27 Nov 2012 09:16:48 +0000 (10:16 +0100)
This also corrects dumping schedule edges.

ir/be/bearch.c
ir/be/beinfo.c
ir/be/beinfo.h

index 63ac05d..7412966 100644 (file)
@@ -129,7 +129,6 @@ int arch_get_op_estimated_cost(const ir_node *irn)
 static reg_out_info_t *get_out_info_n(const ir_node *node, unsigned pos)
 {
        const backend_info_t *info = be_get_info(node);
-       assert(!is_Proj(node));
        assert(pos < (unsigned)ARR_LEN(info->out_infos));
        return &info->out_infos[pos];
 }
@@ -169,21 +168,13 @@ void arch_set_irn_register(ir_node *node, const arch_register_t *reg)
 
 void arch_set_irn_flags(ir_node *node, arch_irn_flags_t flags)
 {
-       backend_info_t *info;
-
-       /* setting flags is only supported for instructions currently.
-        * (mainly because we found no use for it yet and saved the space for
-        * be_infos for them */
-       assert(!is_Proj(node));
-       info = be_get_info(node);
+       backend_info_t *const info = be_get_info(node);
        info->flags = flags;
 }
 
 void arch_add_irn_flags(ir_node *node, arch_irn_flags_t flags)
 {
-       backend_info_t *info;
-       assert(!is_Proj(node));
-       info = be_get_info(node);
+       backend_info_t *const info = be_get_info(node);
        info->flags |= flags;
 }
 
index 05f1b95..611d5c0 100644 (file)
@@ -154,7 +154,7 @@ static void sched_edge_hook(FILE *F, const ir_node *irn)
        if (get_irn_irg(irn)->be_data == NULL)
                return;
 
-       if (sched_is_scheduled(irn) && !is_Block(irn)) {
+       if (!is_Proj(irn) && sched_is_scheduled(irn) && !is_Block(irn)) {
                ir_node *const prev = sched_prev(irn);
                if (!sched_is_begin(prev)) {
                        fprintf(F, "edge:{sourcename: ");
index 3b0e678..15f59cc 100644 (file)
@@ -54,6 +54,7 @@ struct backend_info_t {
 
 static inline backend_info_t *be_get_info(const ir_node *node)
 {
+       assert(!is_Proj(node));
        return (backend_info_t*) node->backend_info;
 }