Ignore generated files.
[libfirm] / ir / ir / irargs.c
index 91cc837..77617ae 100644 (file)
@@ -90,11 +90,7 @@ static int firm_emit_dbg(lc_appendable_t *app,
        ir_node *irn = arg->v_ptr;
        dbg_info *dbg = get_irn_dbg_info(irn);
 
-       buf[0] = '\0';
-       if (dbg && __dbg_info_snprint) {
-               if (__dbg_info_snprint(buf, sizeof(buf), dbg) <= 0)
-                       buf[0] = '\0';
-       }
+       ir_dbg_info_snprint(buf, sizeof(buf), dbg);
        return lc_arg_append(app, occ, buf, strlen(buf));
 }
 
@@ -140,10 +136,14 @@ static int firm_emit(lc_appendable_t *app,
                        isupper(occ->conversion) ? get_entity_ld_name_ex(X): get_entity_name(X));
                snprintf(add, sizeof(add), "[%ld]", get_entity_nr(X));
                break;
-       case k_type:
-               snprintf(buf, sizeof(buf), "%s%s:%s", A("type"), get_type_tpop_name(X), get_type_name(X));
+       case k_type: {
+               char type_name[256];
+               ir_print_type(type_name, sizeof(type_name), X);
+               snprintf(buf, sizeof(buf), "%s%s:%s", A("type"), get_type_tpop_name(X),
+                        type_name);
                snprintf(add, sizeof(add), "[%ld]", get_type_nr(X));
                break;
+       }
        case k_ir_graph:
                if (X == get_const_code_irg())
                        snprintf(buf, sizeof(buf), "%s<ConstCodeIrg>", A("irg"));
@@ -155,8 +155,8 @@ static int firm_emit(lc_appendable_t *app,
                switch (occ->conversion) {
                case 'B':
                        block = is_no_Block(X) ? get_nodes_block(X) : X;
-                       snprintf(buf, sizeof(buf), "%s%s%s", A("irn"), get_irn_opname(block),
-                               get_mode_name(get_irn_mode(block)));
+                       snprintf(buf, sizeof(buf), "%s%s %s", A("irn"),
+                                get_irn_opname(block), get_mode_name(get_irn_mode(block)));
                        snprintf(add, sizeof(add), "[%ld]", get_irn_node_nr(block));
                        break;
                case 'N':
@@ -169,15 +169,21 @@ static int firm_emit(lc_appendable_t *app,
                                        tarval_snprintf(tv_buf, sizeof(tv_buf), tv);
                                else
                                        strncpy(tv_buf, "(NULL)", sizeof(tv_buf));
-                               snprintf(buf, sizeof(buf), "%s%s%s<%s>", A("irn"), get_irn_opname(X),
+                               snprintf(buf, sizeof(buf), "%s%s %s<%s>", A("irn"), get_irn_opname(X),
                                        get_mode_name(get_irn_mode(X)), tv_buf);
-                       }
-                       else
-                               snprintf(buf, sizeof(buf), "%s%s%s", A("irn"), get_irn_opname(X),
+                       } else if (is_SymConst_addr_ent(X)) {
+                               snprintf(buf, sizeof(buf), "%s%s %s[%s]", A("irn"), get_irn_opname(X),
+                               get_mode_name(get_irn_mode(X)), get_entity_name(get_SymConst_entity(X)));
+                       } else if (is_Sel(X)) {
+                               snprintf(buf, sizeof(buf), "%s%s %s[%s]", A("irn"), get_irn_opname(X),
+                               get_mode_name(get_irn_mode(X)), get_entity_name(get_Sel_entity(X)));
+                       } else {
+                               snprintf(buf, sizeof(buf), "%s%s %s", A("irn"), get_irn_opname(X),
                                get_mode_name(get_irn_mode(X)));
-                       snprintf(add, sizeof(add), "[%ld:%d]", get_irn_node_nr(X), get_irn_idx(X));
                        }
-                       break;
+                       snprintf(add, sizeof(add), "[%ld:%d]", get_irn_node_nr(X), get_irn_idx(X));
+               }
+               break;
        case k_ir_mode:
                snprintf(buf, sizeof(buf), "%s%s", A("mode"), get_mode_name(X));
                break;
@@ -197,12 +203,12 @@ static int firm_emit(lc_appendable_t *app,
                for (i = 0; i < n; ++i) {
                        ent = get_compound_graph_path_node(X, i);
 
-                       strncat(buf, ".", sizeof(buf));
-                       strncat(buf, get_entity_name(ent), sizeof(buf));
+                       strncat(buf, ".", sizeof(buf)-1);
+                       strncat(buf, get_entity_name(ent), sizeof(buf)-1);
                        if (is_Array_type(get_entity_owner(ent))) {
                                snprintf(add, sizeof(add), "[%d]",
                                        get_compound_graph_path_array_index(X, i));
-                               strncat(buf, add, sizeof(buf));
+                               strncat(buf, add, sizeof(buf)-1);
                        }
                }
                add[0] = '\0';
@@ -219,7 +225,7 @@ static int firm_emit(lc_appendable_t *app,
        }
 
        if (occ->flag_plus)
-               strncat(buf, add, sizeof(buf));
+               strncat(buf, add, sizeof(buf)-1);
 
        return lc_arg_append(app, occ, buf, strlen(buf));