add some const qualifiers to backedges query functions
[libfirm] / ir / ir / irargs.c
index d08a93d..5af12d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -118,7 +118,7 @@ static int firm_emit(lc_appendable_t *app,
 
        void *X = (void*)arg->v_ptr;
        firm_kind *obj = (firm_kind*)X;
-       int i, n;
+       size_t i, n;
        ir_node *block;
        char add[64];
        char buf[256];
@@ -189,6 +189,9 @@ static int firm_emit(lc_appendable_t *app,
                        } else if (is_Sel(node)) {
                                snprintf(buf, sizeof(buf), "%s%s %s[%s]", A("irn"), get_irn_opname(node),
                                get_mode_name(get_irn_mode(node)), get_entity_name(get_Sel_entity(node)));
+                       } else if (is_Cmp(node)) {
+                               ir_relation relation = get_Cmp_relation(node);
+                               snprintf(buf, sizeof(buf), "%s%s %s", A("irn"), get_irn_opname(node), get_relation_string(relation));
                        } else {
                                snprintf(buf, sizeof(buf), "%s%s %s", A("irn"), get_irn_opname(node),
                                get_mode_name(get_irn_mode(node)));
@@ -210,7 +213,7 @@ static int firm_emit(lc_appendable_t *app,
        }
        case k_ir_loop: {
                ir_loop *loop = (ir_loop*)X;
-               snprintf(buf, sizeof(buf), "loop[%d:%d]", get_loop_loop_nr(loop), get_loop_depth(loop));
+               snprintf(buf, sizeof(buf), "loop[%ld:%u]", get_loop_loop_nr(loop), get_loop_depth(loop));
                break;
        }
        case k_ir_op: {
@@ -228,7 +231,7 @@ static int firm_emit(lc_appendable_t *app,
                        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]",
+                               snprintf(add, sizeof(add), "[%ld]",
                                        get_compound_graph_path_array_index(path, i));
                                strncat(buf, add, sizeof(buf)-1);
                        }
@@ -290,7 +293,7 @@ static int firm_emit_pnc(lc_appendable_t *app,
     const lc_arg_occ_t *occ, const lc_arg_value_t *arg)
 {
        int value = arg->v_int;
-       const char *p = get_pnc_string(value);
+       const char *p = get_relation_string(value);
 
        return lc_arg_append(app, occ, p, strlen(p));
 }