/** Computes a definite name for this entity by concatenating
the name of the owner type and the name of the entity with
a separating "_". */
-ident *mangle_entity (ir_entity *ent);
+ident *id_mangle_entity (ir_entity *ent);
/** mangle underscore: Returns a new ident that represents first_scnd. */
-ident *mangle_u (ident *first, ident* scnd);
+ident *id_mangle_u (ident *first, ident* scnd);
/** mangle dot: Returns a new ident that represents first.scnd. */
-ident *mangle_dot (ident *first, ident* scnd);
+ident *id_mangle_dot (ident *first, ident* scnd);
/** mangle: Returns a new ident that represents firstscnd. */
-ident *mangle (ident *first, ident* scnd);
+ident *id_mangle (ident *first, ident* scnd);
/** Returns a new ident that represents 'prefixscndsuffix'. */
-ident *mangle3 (const char *prefix, ident *middle, const char *suffix);
+ident *id_mangle3 (const char *prefix, ident *middle, const char *suffix);
/** returns a mangled name for a Win32 function using it's calling convention */
-ident *decorate_win32_c_fkt(ir_entity *ent, ident *id);
+ident *id_decorate_win32_c_fkt(ir_entity *ent, ident *id);
#endif
*/
static ir_graph *get_implementing_graph (ir_entity *method)
{
-#if 0
- ir_graph *graph = get_entity_irg ((ir_entity*) method);
-
- /* Search upwards in the overwrites graph. */
- /* GL: this will not work for multiple inheritance */
- if (NULL == graph) {
- int i;
- int n_over = get_entity_n_overwrites ((ir_entity*) method);
-
- for (i = 0; (NULL == graph) && (i < n_over); i ++) {
- ir_entity *over = get_entity_overwrites ((ir_entity*) method, i);
- graph = get_implementing_graph (over);
- }
- }
-
- /* GL this is not valid in our remove irg algorithm ... which we removed by now ... */
- assert(get_entity_peculiarity(method) == peculiarity_description
- || graph == get_entity_irg(get_SymConst_entity(get_atomic_ent_value(method))));
-
- /* we *must* always return a graph != NULL, *except* when we're used
- inside remove_irg or force_description */
- /* assert (graph && "no graph"); */
-
- return (graph);
-#else
ir_graph *graph = NULL;
if (get_entity_peculiarity(method) != peculiarity_description)
graph = get_entity_irg(get_SymConst_entity(get_atomic_ent_value(method)));
return graph;
-#endif
}
/**
abstract now. Pretend that it wasn't there at all, and every
entity that used to inherit this entity's graph is now abstract.
*/
-/* Since we *know* that this entity will not be called, this is OK. */
-static void force_description (ir_entity *ent, ir_entity *addr)
-{
- int i, n_over = get_entity_n_overwrittenby (ent);
-
- set_entity_peculiarity (ent, peculiarity_description);
-
- for (i = 0; i < n_over; i ++) {
- ir_entity *over = get_entity_overwrittenby (ent, i);
-
- if (peculiarity_inherited == get_entity_peculiarity (over)) {
- /* We rely on the fact that cse is performed on the const_code_irg. */
- ir_entity *my_addr = get_SymConst_entity(get_atomic_ent_value(over));
-
- if (addr == my_addr) {
- force_description (over, addr);
- }
- } else if (peculiarity_existent == get_entity_peculiarity (over)) {
- /* check whether 'over' forces 'inheritance' of *our* graph: */
- ir_node *f_addr = get_atomic_ent_value (over);
- ir_entity *impl_ent = get_SymConst_entity (f_addr);
-
- assert(is_SymConst(f_addr) && "can't do complex addrs");
- if (impl_ent == addr) {
- assert (0 && "gibt's denn sowas");
- force_description (over, addr);
- }
- }
- }
-}
/**
Initialize the static data structures.
ir_entity **map;
*param_map = map = obstack_alloc(&env->obst, n * sizeof(ir_entity *));
- res = new_type_struct(mangle_u(id, new_id_from_chars("arg_type", 8)));
+ res = new_type_struct(id_mangle_u(id, new_id_from_chars("arg_type", 8)));
for (i = 0; i < n; ++i, curr += inc) {
ir_type *param_type = get_method_param_type(method_type, curr);
be_abi_call_arg_t *arg = get_call_arg(call, 0, curr);
{
ir_type *type = get_entity_type(method);
ident *old_id = get_entity_ld_ident(method);
- ident *id = mangle3("L", old_id, "$stub");
+ ident *id = id_mangle3("L", old_id, "$stub");
ir_type *parent = be->pic_trampolines_type;
ir_entity *ent = new_entity(parent, old_id, type);
set_entity_ld_ident(ent, id);
static ir_entity *create_pic_symbol(be_main_env_t *be, ir_entity *entity)
{
ident *old_id = get_entity_ld_ident(entity);
- ident *id = mangle3("L", old_id, "$non_lazy_ptr");
+ ident *id = id_mangle3("L", old_id, "$non_lazy_ptr");
ir_type *e_type = get_entity_type(entity);
ir_type *type = new_type_pointer(id, e_type, mode_P_data);
ir_type *parent = be->pic_symbols_type;
if (ent && ! *ent) {
#define IDENT(s) new_id_from_chars(s, sizeof(s)-1)
- ident *id = mangle(IDENT("L"), get_op_ident(op));
+ ident *id = id_mangle(IDENT("L"), get_op_ident(op));
*ent = new_entity(get_glob_type(), id, method);
}
return tp->name;
}
-ident *mangle_entity(ir_entity *ent) {
+ident *id_mangle_entity(ir_entity *ent) {
ident *type_id;
char *cp;
int len;
/* Returns a new ident that represents 'firstscnd'. */
-ident *mangle(ident *first, ident *scnd) {
+ident *id_mangle(ident *first, ident *scnd) {
char *cp;
int len;
ident *res;
}
/** Returns a new ident that represents 'prefixscndsuffix'. */
-ident *mangle3(const char *prefix, ident *scnd, const char *suffix) {
+ident *id_mangle3(const char *prefix, ident *scnd, const char *suffix) {
char *cp;
int len;
ident *res;
}
/** Returns a new ident that represents first<c>scnd. */
-static ident *mangle_3(ident *first, char c, ident* scnd) {
+static ident *id_mangle_3(ident *first, char c, ident* scnd) {
char *cp;
int len;
ident *res;
}
/* Returns a new ident that represents first_scnd. */
-ident *mangle_u(ident *first, ident* scnd) {
- return mangle_3(first, '_', scnd);
+ident *id_mangle_u(ident *first, ident* scnd) {
+ return id_mangle_3(first, '_', scnd);
}
/* Returns a new ident that represents first.scnd. */
-ident *mangle_dot(ident *first, ident* scnd) {
- return mangle_3(first, '.', scnd);
+ident *id_mangle_dot(ident *first, ident* scnd) {
+ return id_mangle_3(first, '.', scnd);
}
/* returns a mangled name for a Win32 function using it's calling convention */
-ident *decorate_win32_c_fkt(ir_entity *ent, ident *id) {
+ident *id_decorate_win32_c_fkt(ir_entity *ent, ident *id) {
ir_type *tp = get_entity_type(ent);
unsigned cc_mask = get_method_calling_convention(tp);
char buf[16];
int size, i;
if (IS_CDECL(cc_mask))
- return mangle3("_", id, "");
+ return id_mangle3("_", id, "");
else if (IS_STDCALL(cc_mask)) {
size = 0;
for (i = get_method_n_params(tp) - 1; i >= 0; --i) {
snprintf(buf, sizeof(buf), "@%d", size);
if (cc_mask & cc_reg_param)
- return mangle3("@", id, buf);
+ return id_mangle3("@", id, buf);
else
- return mangle3("_", id, buf);
+ return id_mangle3("_", id, buf);
}
return id;
}
set_entity_irg(ent, res);
/*-- a class type so that it can contain "inner" methods as in Pascal. --*/
- res->frame_type = new_type_frame(mangle(get_entity_ident(ent), frame_type_suffix));
+ res->frame_type = new_type_frame(id_mangle(get_entity_ident(ent), frame_type_suffix));
/* the Anchor node must be created first */
res->anchor = new_Anchor(res);
if (e)
res = e->value;
else {
- res = new_type_pointer(mangle_u(get_type_ident(e_type), new_id_from_chars("Ptr", 3)), e_type, mode);
+ res = new_type_pointer(id_mangle_u(get_type_ident(e_type), new_id_from_chars("Ptr", 3)), e_type, mode);
set_type_alignment_bytes(res, alignment);
pmap_insert(type_map, e_type, res);
}
}
/* create the new type */
- id = mangle_u(new_id_from_chars("L", 1), get_type_ident(mtp));
+ id = id_mangle_u(new_id_from_chars("L", 1), get_type_ident(mtp));
lowered = new_d_type_method(id, nn_params, nn_ress, get_type_dbg_info(mtp));
/* fill it */
} /* if */
} /* for */
- id = mangle_u(new_id_from_chars("L", 1), get_type_ident(mtp));
+ id = id_mangle_u(new_id_from_chars("L", 1), get_type_ident(mtp));
res = new_type_method(id, n_param, n_res);
/* set param types and result types */
snprintf(clone_postfix, sizeof(clone_postfix), "_cl_%d_%u", pos, nr);
- return mangle(id, new_id_from_str(clone_postfix));
+ return id_mangle(id, new_id_from_str(clone_postfix));
}
/**
} else {
ir_mode *mode = is_Method_type(tp) ? mode_P_code : mode_P_data;
- res = new_type_pointer(mangle_u(get_type_ident(tp), ptr_type_suffix), tp, mode);
+ res = new_type_pointer(id_mangle_u(get_type_ident(tp), ptr_type_suffix), tp, mode);
/* Update trout for pointer types, so we can use it in next call. */
add_type_pointertype_to(tp, res);
}
else {
res = find_pointer_type_to_type(tp);
if (res == firm_unknown_type)
- res = new_type_pointer(mangle_u(get_type_ident(tp), ptr_type_suffix), tp, mode_P_data);
+ res = new_type_pointer(id_mangle_u(get_type_ident(tp), ptr_type_suffix), tp, mode_P_data);
}
return res;
{
assert(ent && ent->kind == k_entity);
if (ent->ld_name == NULL)
- ent->ld_name = mangle_entity(ent);
+ ent->ld_name = id_mangle_entity(ent);
return ent->ld_name;
}
/* ----------------------------------------------------------------------- */
ident *default_mangle_inherited_name(ir_entity *super, ir_type *clss) {
- return mangle_u(new_id_from_str("inh"), mangle_u(get_type_ident(clss), get_entity_ident(super)));
+ return id_mangle_u(new_id_from_str("inh"), id_mangle_u(get_type_ident(clss), get_entity_ident(super)));
}
/** Replicates all entities in all super classes that are not overwritten
/* use the parameter name if specified */
if (! id)
- id = mangle_u(name, get_type_ident(elt_type));
+ id = id_mangle_u(name, get_type_ident(elt_type));
tps[i].ent = new_entity(res, id, elt_type);
set_entity_allocation(tps[i].ent, allocation_parameter);
}
name = tp->name;
if (prefix != NULL)
- name = mangle(prefix, name);
+ name = id_mangle(prefix, name);
mode = tp->mode;
n_params = tp->attr.ma.n_params;
if (!method->attr.ma.value_params) {
/* parameter value type not created yet, build */
method->attr.ma.value_params
- = build_value_type(mangle_u(get_type_ident(method), value_params_suffix),
+ = build_value_type(id_mangle_u(get_type_ident(method), value_params_suffix),
get_method_n_params(method), method->attr.ma.params);
}
/*
if (!method->attr.ma.value_ress) {
/* result value type not created yet, build */
method->attr.ma.value_ress
- = build_value_type(mangle_u(get_type_ident(method), value_ress_suffix),
+ = build_value_type(id_mangle_u(get_type_ident(method), value_ress_suffix),
get_method_n_ress(method), method->attr.ma.res_type);
}
/*
current_ir_graph = rem;
res->attr.aa.element_type = element_type;
- new_entity(res, mangle_u(name, new_id_from_chars("elem_ent", 8)), element_type);
+ new_entity(res, id_mangle_u(name, new_id_from_chars("elem_ent", 8)), element_type);
hook_new_type(res);
return res;
}
frame_align = get_type_alignment_bytes(frame_type);
size = (size + frame_align - 1) & ~(frame_align - 1);
- tp = new_type_array(mangle_u(get_type_ident(frame_type), name), 1, a_byte);
+ tp = new_type_array(id_mangle_u(get_type_ident(frame_type), name), 1, a_byte);
set_array_bounds_int(tp, 0, 0, size);
set_type_alignment_bytes(tp, alignment);