change color handling in dumper, tweak colors
[libfirm] / ir / be / begnuas.c
index c2b87bf..df927d5 100644 (file)
@@ -435,7 +435,7 @@ static int ent_is_string_const(ir_entity *ent)
        n = get_compound_ent_n_values(ent);
        for (i = 0; i < n; ++i) {
                ir_node *irn = get_compound_ent_value(ent, i);
-               if(get_irn_opcode(irn) != iro_Const)
+               if (! is_Const(irn))
                        return 0;
 
                c = (int) get_tarval_long(get_Const_tarval(irn));
@@ -528,10 +528,8 @@ static void dump_compound_init(be_gas_decl_env_t *env, obstack_t *obst,
        for (i = 0; i < n; ++i) {
                int offset = get_compound_ent_value_offset_bytes(ent, i);
                int bits_remainder = get_compound_ent_value_offset_bit_remainder(ent, i);
-               const compound_graph_path *path = get_compound_ent_value_path(ent, i);
-               int path_len = get_compound_graph_path_length(path);
-               ir_entity *last_ent = get_compound_graph_path_node(path, path_len - 1);
-               int value_len = get_type_size_bits(get_entity_type(last_ent));
+               ir_node *value = get_compound_ent_value(ent, i);
+               int      value_len = get_mode_size_bits(get_irn_mode(value));
 
                offset += (value_len + bits_remainder + 7) >> 3;
 
@@ -548,13 +546,10 @@ static void dump_compound_init(be_gas_decl_env_t *env, obstack_t *obst,
 
        /* collect the values and store them at the offsets */
        for (i = 0; i < n; ++i) {
-               const compound_graph_path *path = get_compound_ent_value_path(ent, i);
-               int path_len = get_compound_graph_path_length(path);
                int offset = get_compound_ent_value_offset_bytes(ent, i);
                int offset_bits = get_compound_ent_value_offset_bit_remainder(ent, i);
-               ir_node *value = get_compound_ent_value(ent, i);
-               ir_entity *last_ent = get_compound_graph_path_node(path, path_len - 1);
-               int value_len = get_type_size_bits(get_entity_type(last_ent));
+               ir_node   *value = get_compound_ent_value(ent, i);
+               int    value_len = get_mode_size_bits(get_irn_mode(value));
                assert(offset >= 0);
                assert(offset_bits >= 0);