projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check that COnst nodes have same mode as its tarval
[libfirm]
/
ir
/
ir
/
irargs.c
diff --git
a/ir/ir/irargs.c
b/ir/ir/irargs.c
index
42d4174
..
9bf7b3c
100644
(file)
--- a/
ir/ir/irargs.c
+++ b/
ir/ir/irargs.c
@@
-14,6
+14,8
@@
# include "config.h"
#endif
# include "config.h"
#endif
+#ifdef WITH_LIBCORE
+
#include "bitset.h"
#include <ctype.h>
#include "bitset.h"
#include <ctype.h>
@@
-84,6
+86,15
@@
static int firm_emit_dbg(lc_appendable_t *app,
return lc_arg_append(app, occ, buf, strlen(buf));
}
return lc_arg_append(app, occ, buf, strlen(buf));
}
+/**
+ * Beware: do not set the entity ld_name
+ */
+static const char *get_entity_ld_name_ex(entity *ent) {
+ if (ent->ld_name)
+ return get_entity_ld_name(ent);
+ return get_entity_name(ent);
+}
+
/**
* emit a Firm object
*/
/**
* emit a Firm object
*/
@@
-99,6
+110,7
@@
static int firm_emit(lc_appendable_t *app,
char add[64];
char buf[256];
char tv[256];
char add[64];
char buf[256];
char tv[256];
+ entity *ent;
buf[0] = '\0';
add[0] = '\0';
buf[0] = '\0';
add[0] = '\0';
@@
-113,7
+125,7
@@
static int firm_emit(lc_appendable_t *app,
break;
case k_entity:
snprintf(buf, sizeof(buf), "%s%s", A("ent"),
break;
case k_entity:
snprintf(buf, sizeof(buf), "%s%s", A("ent"),
- isupper(occ->conversion) ? get_entity_ld_name(X): get_entity_name(X));
+ 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(add, sizeof(add), "[%ld]", get_entity_nr(X));
break;
case k_type:
@@
-161,23
+173,29
@@
static int firm_emit(lc_appendable_t *app,
snprintf(buf, sizeof(buf), "%s%s", A("op"), get_op_name(X));
break;
case k_ir_compound_graph_path:
snprintf(buf, sizeof(buf), "%s%s", A("op"), get_op_name(X));
break;
case k_ir_compound_graph_path:
- strncat(buf, A("cgp"), sizeof(buf));
-
n = get_compound_graph_path_length(X);
n = get_compound_graph_path_length(X);
+
for (i = 0; i < n; ++i) {
for (i = 0; i < n; ++i) {
- entity *ent = get_compound_graph_path_node(X, i);
+ ent = get_compound_graph_path_node(X, i);
+
+ strncat(buf, ".", sizeof(buf));
strncat(buf, get_entity_name(ent), sizeof(buf));
strncat(buf, get_entity_name(ent), sizeof(buf));
- if (i < n - 1)
- strncat(buf, ".", sizeof(buf));
+ 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));
+ }
}
}
+ add[0] = '\0';
break;
break;
+
default:
snprintf(buf, sizeof(buf), "UNKWN");
snprintf(add, sizeof(add), "[%p]", X);
}
}
default:
snprintf(buf, sizeof(buf), "UNKWN");
snprintf(add, sizeof(add), "[%p]", X);
}
}
- if(occ->flag_plus)
+ if
(occ->flag_plus)
strncat(buf, add, sizeof(buf));
return lc_arg_append(app, occ, buf, strlen(buf));
strncat(buf, add, sizeof(buf));
return lc_arg_append(app, occ, buf, strlen(buf));
@@
-251,6
+269,7
@@
lc_arg_env_t *firm_get_arg_env(void)
X("mode", 'm'),
X("block", 'B'),
X("pnc", '='),
X("mode", 'm'),
X("block", 'B'),
X("pnc", '='),
+ X("cg_path", 'P'),
};
int i;
};
int i;
@@
-272,3
+291,5
@@
lc_arg_env_t *firm_get_arg_env(void)
return env;
}
return env;
}
+
+#endif /* WITH_LIBCORE */