Commit 99c28678 authored by Matthias Braun's avatar Matthias Braun
Browse files

Use ir_printf("%F") instead of printf("%s",get_entity_name())

parent 851474f8
......@@ -68,10 +68,8 @@ void arm_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
if (arm_has_address_attr(n)) {
const arm_Address_attr_t *attr = get_arm_Address_attr_const(n);
if (attr->entity != NULL) {
fputc(' ', F);
fputs(get_entity_name(attr->entity), F);
}
if (attr->entity != NULL)
ir_fprintf(F, " %F", attr->entity);
}
break;
......@@ -152,7 +150,7 @@ void arm_dump_node(FILE *F, const ir_node *n, dump_reason_t reason)
fprintf(F, "entity = ");
if (attr->entity != NULL) {
fprintf(F, "'%s'", get_entity_name(attr->entity));
ir_fprintf(F, "'%F'", attr->entity);
} else {
fputs("NULL", F);
}
......
......@@ -615,9 +615,9 @@ static void dump_node(FILE *f, const ir_node *irn, dump_reason_t reason)
ir_entity *in = be_get_MemPerm_in_entity(irn, i);
ir_entity *out = be_get_MemPerm_out_entity(irn, i);
if (in != NULL)
fprintf(f, "\nin[%u]: %s\n", i, get_entity_name(in));
ir_fprintf(f, "\nin[%u]: %F\n", i, in);
if (out != NULL)
fprintf(f, "\nout[%u]: %s\n", i, get_entity_name(out));
ir_fprintf(f, "\nout[%u]: %F\n", i, out);
}
}
break;
......
......@@ -125,7 +125,7 @@ static void ia32_dump_immediate(FILE *const F, ir_entity *const entity,
int32_t const offset)
{
if (entity) {
fputs(get_entity_name(entity), F);
ir_fprintf(F, "%F", entity);
if (offset != 0)
fprintf(F, "%+" PRId32, offset);
} else {
......
......@@ -619,12 +619,16 @@ static void check_ent_nr(ir_type *const type, ir_entity *const entity, void *con
/**
* Type-walker: Find an entity with given name.
*/
static void check_ent_name(ir_type *const type, ir_entity *const entity, void *const ctx)
static void check_ent_name(ir_type *const type, ir_entity *const entity,
void *const ctx)
{
(void)type;
if (entity == NULL)
return;
find_env_t *env = (find_env_t*)ctx;
if (entity && streq(get_entity_name(entity), env->u.name))
const char *name = get_entity_name(entity);
if (streq(name, env->u.name))
env->res = entity;
}
......
......@@ -144,7 +144,7 @@ static int firm_emit(lc_appendable_t *app, const lc_arg_occ_t *occ,
if (irg == get_const_code_irg())
snprintf(buf, sizeof(buf), "%s<ConstCodeIrg>", A("irg"));
else
snprintf(buf, sizeof(buf), "%s%s", A("irg"), get_entity_name(get_irg_entity(irg)));
ir_snprintf(buf, sizeof(buf), "%s%F", A("irg"), get_irg_entity(irg));
snprintf(add, sizeof(add), "[%ld]", get_irg_graph_nr(irg));
break;
}
......
......@@ -632,7 +632,7 @@ void dump_node_opcode(FILE *F, const ir_node *n)
/* implementation for default nodes */
switch (get_irn_opcode(n)) {
case iro_Address:
fprintf(F, "%s &%s", name, get_entity_name(get_Address_entity(n)));
ir_fprintf(F, "%s &%F", name, get_Address_entity(n));
break;
case iro_Align:
......@@ -683,7 +683,7 @@ void dump_node_opcode(FILE *F, const ir_node *n)
break;
case iro_Offset:
fprintf(F, "%s %s", name, get_entity_name(get_Offset_entity(n)));
ir_fprintf(F, "%s %F", name, get_Offset_entity(n));
break;
case iro_Size:
......
......@@ -222,7 +222,7 @@ void dump_irnode_to_file(FILE *const F, const ir_node *const n)
case iro_Member: {
const ir_entity *ent = get_Member_entity(n);
if (ent != NULL) {
fprintf(F, " Selecting entity %s (%ld)\n", get_entity_name(ent), get_entity_nr(ent));
ir_fprintf(F, " Selecting entity %+F\n", ent);
ir_fprintf(F, " of type %+F\n", get_entity_type(ent));
ir_fprintf(F, " with owner %+F.\n", get_entity_owner(ent));
} else {
......@@ -510,15 +510,13 @@ static void dump_entity_to_file_prefix(FILE *const F,
const ir_type *owner = get_entity_owner(ent);
const ir_type *type = get_entity_type(ent);
if (verbosity & dump_verbosity_onlynames) {
fprintf(F, "%sentity %s.%s (%ld)\n", prefix,
get_compound_name(owner), get_entity_name(ent),
get_entity_nr(ent));
ir_fprintf(F, "%sentity %s.%+F\n", prefix, get_compound_name(owner),
ent);
return;
}
if (verbosity & dump_verbosity_entattrs) {
fprintf(F, "%sentity %s (%ld)\n", prefix, get_entity_name(ent),
get_entity_nr(ent));
ir_fprintf(F, "%sentity %+F\n", prefix, ent);
ir_fprintf(F, "%s type: %+F\n", prefix, type);
ir_fprintf(F, "%s owner: %+F\n", prefix, owner);
......@@ -527,8 +525,8 @@ static void dump_entity_to_file_prefix(FILE *const F,
fprintf(F, "%s overwrites:\n", prefix);
for (size_t i = 0; i < get_entity_n_overwrites(ent); ++i) {
const ir_entity *ov = get_entity_overwrites(ent, i);
ir_fprintf(F, "%s %d: %s of class %+F\n", prefix, i,
get_entity_name(ov), get_entity_owner(ov));
ir_fprintf(F, "%s %d: %F of class %+F\n", prefix, i, ov,
get_entity_owner(ov));
}
} else {
fprintf(F, "%s Does not overwrite other entities.\n", prefix);
......@@ -537,8 +535,8 @@ static void dump_entity_to_file_prefix(FILE *const F,
fprintf(F, "%s overwritten by:\n", prefix);
for (size_t i = 0; i < get_entity_n_overwrittenby(ent); ++i) {
const ir_entity *ov = get_entity_overwrittenby(ent, i);
ir_fprintf(F, "%s %d: %s of class %+F\n", prefix, i,
get_entity_name(ov), get_entity_owner(ov));
ir_fprintf(F, "%s %d: %F of class %+F\n", prefix, i, ov,
get_entity_owner(ov));
}
} else {
fprintf(F, "%s Is not overwritten by other entities.\n",
......@@ -549,14 +547,14 @@ static void dump_entity_to_file_prefix(FILE *const F,
fprintf(F, "%s transitive overwrites:\n", prefix);
for (const ir_entity *ov = get_entity_trans_overwrites_first(ent);
ov != NULL; ov = get_entity_trans_overwrites_next(ent)) {
ir_fprintf(F, "%s : %s of class %+F\n", prefix,
get_entity_name(ov), get_entity_owner(ov));
ir_fprintf(F, "%s : %F of class %+F\n", prefix, ov,
get_entity_owner(ov));
}
fprintf(F, "%s transitive overwritten by:\n", prefix);
for (const ir_entity *ov = get_entity_trans_overwrittenby_first(ent);
ov != NULL; ov = get_entity_trans_overwrittenby_next(ent)) {
ir_fprintf(F, "%s : %s of class %+F\n", prefix,
get_entity_name(ov), get_entity_owner(ov));
ir_fprintf(F, "%s : %F of class %+F\n", prefix, ov,
get_entity_owner(ov));
}
}
}
......@@ -587,7 +585,7 @@ static void dump_entity_to_file_prefix(FILE *const F,
}
}
} else { /* no entattrs */
ir_fprintf(F, "%s %+F: %s", prefix, type, get_entity_name(ent));
ir_fprintf(F, "%s %+F: %F", prefix, type, ent);
if (is_Method_type(type))
fputs("(...)", F);
if (is_entity_compound_member(ent)) {
......
......@@ -407,10 +407,10 @@ static unsigned allocate_value_numbers(pset *members, ir_entity *ent,
#ifdef DEBUG_libfirm
/* Debug output */
DB((dbg, SET_LEVEL_2, " %s", get_entity_name(key->path[0].ent)));
DB((dbg, SET_LEVEL_2, " %F", key->path[0].ent));
for (unsigned i = 1; i < key->path_len; ++i) {
if (is_entity(key->path[i].ent))
DB((dbg, SET_LEVEL_2, ".%s", get_entity_name(key->path[i].ent)));
DB((dbg, SET_LEVEL_2, ".%F", key->path[i].ent));
else
DB((dbg, SET_LEVEL_2, "[%ld]", get_tarval_long(key->path[i].tv)));
}
......@@ -605,11 +605,11 @@ void scalar_replacement_opt(ir_graph *irg)
ir_type *ent_type = get_entity_type(ent);
if (is_Array_type(ent_type)) {
DB((dbg, SET_LEVEL_1, " found array %s\n", get_entity_name(ent)));
DB((dbg, SET_LEVEL_1, " found array %F\n", ent));
} else if (is_compound_type(ent_type)) {
DB((dbg, SET_LEVEL_1, " found struct %s\n", get_entity_name(ent)));
DB((dbg, SET_LEVEL_1, " found struct %F\n", ent));
} else if (is_atomic_type(ent_type)) {
DB((dbg, SET_LEVEL_1, " found atomic value %s\n", get_entity_name(ent)));
DB((dbg, SET_LEVEL_1, " found atomic value %F\n", ent));
} else {
panic("neither an array nor a struct or atomic value found in scalar replace");
}
......
......@@ -1037,7 +1037,7 @@ ir_type *clone_frame_type(ir_type *type)
ir_type *res = new_type_frame();
for (size_t i = 0, n = get_compound_n_members(type); i < n; ++i) {
ir_entity *ent = get_compound_member(type, i);
ident *name = get_entity_name(ent);
ident *name = get_entity_ident(ent);
ir_entity *nent = clone_entity(ent, name, res);
set_entity_link(ent, nent);
set_entity_link(nent, ent);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment