From 31eaa75da62468af4c37778e42ef7cecbe654838 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 13 Dec 2006 20:08:31 +0000 Subject: [PATCH] rename type entity into ir_entity [r8456] --- ir/arch/modeconv.c | 6 +++--- ir/debug/dbginfo.c | 4 ++-- ir/debug/dbginfo.h | 4 ++-- ir/debug/debugger.c | 18 ++++++++-------- ir/debug/firm_ycomp.c | 2 +- ir/opt/data_flow_scalar_replace.c | 34 ++++++++++++++--------------- ir/opt/funccall.c | 6 +++--- ir/opt/ldstopt.c | 18 ++++++++-------- ir/opt/opt_frame.c | 2 +- ir/opt/opt_polymorphy.c | 14 ++++++------ ir/opt/proc_cloning.c | 22 +++++++++---------- ir/opt/scalar_replace.c | 16 +++++++------- ir/opt/strength_red.c | 11 +++++----- ir/opt/tailrec.c | 4 ++-- ir/opt/tropt.c | 2 +- ir/stat/firmstat.c | 20 ++++++++--------- ir/stat/firmstat_t.h | 2 +- ir/tr/entity.h | 2 +- ir/tr/mangle.c | 4 ++-- ir/tr/mangle.h | 8 +++---- ir/tr/tpop_t.h | 6 +++--- ir/tr/tr_inheritance.c | 36 +++++++++++++++---------------- ir/tr/tr_inheritance.h | 16 +++++++------- ir/tr/trvrfy.c | 20 ++++++++--------- ir/tr/trvrfy.h | 2 +- ir/tr/type_or_entity.h | 4 ++-- ir/tr/type_t.h | 26 +++++++++++----------- ir/tr/typewalk.c | 18 ++++++++-------- ir/tr/typewalk.h | 2 +- 29 files changed, 165 insertions(+), 164 deletions(-) diff --git a/ir/arch/modeconv.c b/ir/arch/modeconv.c index 5a3d59788..028aa8d4e 100644 --- a/ir/arch/modeconv.c +++ b/ir/arch/modeconv.c @@ -128,9 +128,9 @@ static void do_mode_conv(ir_node *n, void *env) /* special case: fix the Return */ if (is_Return(n)) { - entity *ent = get_irg_entity(current_ir_graph); - ir_type *mt = get_entity_type(ent); - int i, n_ress = get_method_n_ress(mt); + ir_entity *ent = get_irg_entity(current_ir_graph); + ir_type *mt = get_entity_type(ent); + int i, n_ress = get_method_n_ress(mt); mode = mode_is_signed(mode) ? wenv->s_mode : wenv->u_mode; block = get_nodes_block(n); diff --git a/ir/debug/dbginfo.c b/ir/debug/dbginfo.c index 02ea494bc..49412f3fd 100644 --- a/ir/debug/dbginfo.c +++ b/ir/debug/dbginfo.c @@ -59,11 +59,11 @@ get_irn_dbg_info(const ir_node *n) { /* Routines to access the field of an entity containing the debugging information. */ -void set_entity_dbg_info(entity *ent, dbg_info* db) { +void set_entity_dbg_info(ir_entity *ent, dbg_info* db) { ent->dbi = db; } -dbg_info *get_entity_dbg_info(entity *ent) { +dbg_info *get_entity_dbg_info(ir_entity *ent) { return ent->dbi; } diff --git a/ir/debug/dbginfo.h b/ir/debug/dbginfo.h index 39ed3e7fa..d119b956f 100644 --- a/ir/debug/dbginfo.h +++ b/ir/debug/dbginfo.h @@ -65,12 +65,12 @@ dbg_info *get_irn_dbg_info(const ir_node *n); /** * Sets the debug information of an entity. */ -void set_entity_dbg_info(entity *ent, dbg_info *db); +void set_entity_dbg_info(ir_entity *ent, dbg_info *db); /** * Returns the debug information of an entity. */ -dbg_info *get_entity_dbg_info(entity *ent); +dbg_info *get_entity_dbg_info(ir_entity *ent); /** * Sets the debug information of a type. diff --git a/ir/debug/debugger.c b/ir/debug/debugger.c index 00cfe05b6..c9ea7097c 100644 --- a/ir/debug/debugger.c +++ b/ir/debug/debugger.c @@ -312,7 +312,7 @@ static void dbg_free_graph(void *ctx, ir_graph *irg) } { bp_ident_t key, *elem; - entity *ent = get_irg_entity(irg); + ir_entity *ent = get_irg_entity(irg); if (! ent) return; @@ -334,7 +334,7 @@ static void dbg_free_graph(void *ctx, ir_graph *irg) * @param ctx the hook context * @param ent the newly created entity */ -static void dbg_new_entity(void *ctx, entity *ent) +static void dbg_new_entity(void *ctx, ir_entity *ent) { { bp_ident_t key, *elem; @@ -729,14 +729,14 @@ typedef struct find_env { long nr; /**< the number that is searched for */ const char *name; /**< the name that is searched for */ } u; - entity *res; /**< the result */ + ir_entity *res; /**< the result */ } find_env_t; /** * Type-walker: Find an entity with given number. */ static void check_ent_nr(type_or_ent *tore, void *ctx) { - entity *ent = (entity *)tore; + ir_entity *ent = (ir_entity *)tore; find_env_t *env = ctx; if (is_entity(ent)) @@ -749,7 +749,7 @@ static void check_ent_nr(type_or_ent *tore, void *ctx) { * Type-walker: Find an entity with given name. */ static void check_ent_name(type_or_ent *tore, void *ctx) { - entity *ent = (entity *)tore; + ir_entity *ent = (ir_entity *)tore; find_env_t *env = ctx; if (is_entity(ent)) @@ -761,7 +761,7 @@ static void check_ent_name(type_or_ent *tore, void *ctx) { /** * Find a firm entity by its number. */ -static entity *find_entity_nr(long nr) { +static ir_entity *find_entity_nr(long nr) { find_env_t env; env.u.nr = nr; @@ -773,7 +773,7 @@ static entity *find_entity_nr(long nr) { /** * Find a firm entity by its name. */ -static entity *find_entity_name(const char *name) { +static ir_entity *find_entity_name(const char *name) { find_env_t env; env.u.name = name; @@ -789,7 +789,7 @@ static void show_by_name(type_or_ent *tore, void *env) { ident *id = (ident *)env; if (is_entity(tore)) { - entity *ent = (entity *)tore; + ir_entity *ent = (ir_entity *)tore; if (is_method_entity(ent)) { if (get_entity_ident(ent) == id) { @@ -817,7 +817,7 @@ static void show_by_ldname(type_or_ent *tore, void *env) { ident *id = (ident *)env; if (is_entity(tore)) { - entity *ent = (entity *)tore; + ir_entity *ent = (ir_entity *)tore; if (is_method_entity(ent)) { if (get_entity_ld_ident(ent) == id) { diff --git a/ir/debug/firm_ycomp.c b/ir/debug/firm_ycomp.c index 0e9c09bd2..d4e76c752 100644 --- a/ir/debug/firm_ycomp.c +++ b/ir/debug/firm_ycomp.c @@ -290,7 +290,7 @@ static void firm_ycomp_debug_new_node(void *context, ir_graph *graph, ir_node *n /** * Clear the old irg if it has some data and create a new one. */ -static void firm_ycomp_debug_new_irg(void *context, ir_graph *irg, entity *ent) { +static void firm_ycomp_debug_new_irg(void *context, ir_graph *irg, ir_entity *ent) { firm_ycomp_dbg_t *dbg = context; char buf[SEND_BUF_SIZE]; diff --git a/ir/opt/data_flow_scalar_replace.c b/ir/opt/data_flow_scalar_replace.c index b49127df2..7a7ee5e9c 100644 --- a/ir/opt/data_flow_scalar_replace.c +++ b/ir/opt/data_flow_scalar_replace.c @@ -49,13 +49,13 @@ typedef struct _ent_leaves_t{ - entity *ent; /**< An entity, that contains scalars for replace.*/ + ir_entity *ent; /**< An entity, that contains scalars for replace.*/ pset *leaves; /**< All leaves of this entity.*/ } ent_leaves_t; typedef struct _sels_t { ir_node *sel; /**< A sel node, thats entity have scalars.*/ - entity *ent; /**< The entity of this sel node.*/ + ir_entity *ent; /**< The entity of this sel node.*/ }sels_t; typedef struct _call_access_t { @@ -88,7 +88,7 @@ typedef struct _leave_t { * accesses like a.b.c[8].d */ typedef union { - entity *ent; + ir_entity *ent; tarval *tv; } path_elem_t; @@ -140,8 +140,8 @@ static int ent_leaves_t_cmp(const void *elt, const void *key, size_t size) */ static int ent_cmp(const void *elt, const void *key) { - const entity *c1 = elt; - const entity *c2 = key; + const ir_entity *c1 = elt; + const ir_entity *c2 = key; return c1 != c2; } @@ -285,7 +285,7 @@ static int is_address_taken(ir_node *sel) * @param ent the entity that will be scalar replaced * @param sel a Sel node that selects some fields of this entity */ -static void link_all_leave_sels(entity *ent, ir_node *sel) +static void link_all_leave_sels(ir_entity *ent, ir_node *sel) { int i, n; @@ -353,7 +353,7 @@ static int find_possible_replacements(ir_graph *irg) ir_node *succ = get_irn_out(irg_frame, i); if (get_irn_op(succ) == op_Sel) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); set_entity_link(ent, NULL); } } @@ -367,7 +367,7 @@ static int find_possible_replacements(ir_graph *irg) ir_node *succ = get_irn_out(irg_frame, i); if (get_irn_op(succ) == op_Sel) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); ir_type *ent_type; if (get_entity_link(ent) == ADDRESS_TAKEN) @@ -468,7 +468,7 @@ static path_t *find_path(ir_node *sel, unsigned len) * * @return the next free value number */ -static unsigned allocate_value_numbers(set *set_sels, pset *leaves, entity *ent, unsigned vnum) +static unsigned allocate_value_numbers(set *set_sels, pset *leaves, ir_entity *ent, unsigned vnum) { ir_node *sel, *next; path_t *key, *path; @@ -612,13 +612,13 @@ static void sync_stored_scalars(ir_node *blk, env_t *env) { val_arr = get_irn_link(pred); if(val_arr[GET_ENT_VNUM(value_ent->ent)].access_type == SYNCED) - /* This entity was synced.*/ - continue; + /* This entity was synced.*/ + continue; if(val_arr[GET_ENT_VNUM(value_ent->ent)].access_type <= 3) { - /* To avoid repeated sync of this entity in this block.*/ - val_arr[GET_ENT_VNUM(value_ent->ent)].access_type = SYNCED; + /* To avoid repeated sync of this entity in this block.*/ + val_arr[GET_ENT_VNUM(value_ent->ent)].access_type = SYNCED; /* In this predecessor block is this entity not acessed. * We must sync in the end ot this block.*/ if(get_Block_n_cfgpreds(blk) > 1) @@ -791,7 +791,7 @@ static void split_call_mem_edge(env_t *env, ir_node *call, pset *accessed_entiti call_access_t key_call, *value_call; ir_node *call_blk, *new_mem_state, *leave; ir_node *sync, **in; - entity *ent; + ir_entity *ent; unsigned ent_vnum; int fix_irn = 0; /**< Set to 1 if we must add this call to it fix list.*/ int *accessed_leaves_vnum = NULL; /**< An arraw, where are saved the value number, that @@ -1213,7 +1213,7 @@ static void analyse_calls(ir_node *irn, void *ctx) { unsigned int acces_type; ir_node *param, *call_ptr, *blk; ir_op *op; - entity *meth_ent; + ir_entity *meth_ent; sels_t key_sels, *value_sels; call_access_t key_call, *value_call; value_arr_entry_t *val_arr; @@ -1330,7 +1330,7 @@ static void set_block_access(ir_node *irn, void *ctx){ vnum = GET_ENT_VNUM(value_leaves->ent); if((get_Block_n_cfgpreds(irn) > 1) && (val_arr[vnum].access_type > 3)) - env->changes = set_block_dominated_first_access(irn, vnum, val_arr[vnum].access_type); + env->changes = set_block_dominated_first_access(irn, vnum, val_arr[vnum].access_type); if((val_arr_pred[vnum].access_type > 3) && (val_arr[vnum].access_type < 3)) { /* We have found a block for update it access and value number information.*/ @@ -1511,7 +1511,7 @@ void data_flow_scalar_replacement_opt(ir_graph *irg) { ir_node *succ = get_irn_out(irg_frame, i); if (get_irn_op(succ) == op_Sel) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); if (get_entity_link(ent) == NULL || get_entity_link(ent) == ADDRESS_TAKEN) continue; diff --git a/ir/opt/funccall.c b/ir/opt/funccall.c index 9e019a561..0cc1637a7 100644 --- a/ir/opt/funccall.c +++ b/ir/opt/funccall.c @@ -42,7 +42,7 @@ static void collect_calls(ir_node *node, void *env) { env_t *ctx = env; ir_node *call, *ptr; - entity *ent; + ir_entity *ent; unsigned mode; if (is_Call(node)) { @@ -330,8 +330,8 @@ static unsigned _follow_mem(ir_node *node) { ptr = get_Call_ptr(node); if (get_irn_op(ptr) == op_SymConst && get_SymConst_kind(ptr) == symconst_addr_ent) { - entity *ent = get_SymConst_entity(ptr); - ir_graph *irg = get_entity_irg(ent); + ir_entity *ent = get_SymConst_entity(ptr); + ir_graph *irg = get_entity_irg(ent); if (irg == current_ir_graph) { /* A recursive call. The did not mode depend on this call */ diff --git a/ir/opt/ldstopt.c b/ir/opt/ldstopt.c index bb407e94b..a74aae4d9 100644 --- a/ir/opt/ldstopt.c +++ b/ir/opt/ldstopt.c @@ -271,7 +271,7 @@ static void collect_nodes(ir_node *node, void *env) /** * Returns an entity if the address ptr points to a constant one. */ -static entity *find_constant_entity(ir_node *ptr) +static ir_entity *find_constant_entity(ir_node *ptr) { for (;;) { ir_op *op = get_irn_op(ptr); @@ -280,8 +280,8 @@ static entity *find_constant_entity(ir_node *ptr) return get_SymConst_entity(ptr); } else if (op == op_Sel) { - entity *ent = get_Sel_entity(ptr); - ir_type *tp = get_entity_owner(ent); + ir_entity *ent = get_Sel_entity(ptr); + ir_type *tp = get_entity_owner(ent); /* Do not fiddle with polymorphism. */ if (is_Class_type(get_entity_owner(ent)) && @@ -350,7 +350,7 @@ static long get_Sel_array_index_long(ir_node *n, int dim) { */ static compound_graph_path *rec_get_accessed_path(ir_node *ptr, int depth) { compound_graph_path *res = NULL; - entity *root, *field; + ir_entity *root, *field; int path_len, pos; if (get_irn_op(ptr) == op_SymConst) { @@ -575,7 +575,7 @@ static unsigned optimize_load(ir_node *load) { ldst_info_t *info = get_irn_link(load); ir_node *mem, *ptr, *new_node; - entity *ent; + ir_entity *ent; unsigned res = 0; /* do NOT touch volatile loads for now */ @@ -599,9 +599,9 @@ static unsigned optimize_load(ir_node *load) if (get_irn_op(skip_Proj(mem)) == op_Alloc) { /* ok, check the types */ - entity *ent = get_Sel_entity(ptr); - ir_type *s_type = get_entity_type(ent); - ir_type *a_type = get_Alloc_type(mem); + ir_entity *ent = get_Sel_entity(ptr); + ir_type *s_type = get_entity_type(ent); + ir_type *a_type = get_Alloc_type(mem); if (is_SubClass_of(s_type, a_type)) { /* ok, condition met: there can't be an exception because @@ -713,7 +713,7 @@ static unsigned optimize_load(ir_node *load) { int j; for (j = 0; j < get_compound_graph_path_length(path); ++j) { - entity *node = get_compound_graph_path_node(path, j); + ir_entity *node = get_compound_graph_path_node(path, j); fprintf(stdout, ".%s", get_entity_name(node)); if (is_Array_type(get_entity_owner(node))) fprintf(stdout, "[%d]", get_compound_graph_path_array_index(path, j)); diff --git a/ir/opt/opt_frame.c b/ir/opt/opt_frame.c index 9304c282c..34bd2e2f8 100644 --- a/ir/opt/opt_frame.c +++ b/ir/opt/opt_frame.c @@ -31,7 +31,7 @@ */ void opt_frame_irg(ir_graph *irg) { ir_type *frame_tp = get_irg_frame_type(irg); - entity *ent, *list; + ir_entity *ent, *list; ir_node *frame, *sel; int i, n = get_class_n_members(frame_tp); diff --git a/ir/opt/opt_polymorphy.c b/ir/opt/opt_polymorphy.c index a1d1f2297..db3853f25 100644 --- a/ir/opt/opt_polymorphy.c +++ b/ir/opt/opt_polymorphy.c @@ -84,7 +84,7 @@ static ir_type *get_dynamic_type(ir_node *ptr) { /** * Check, if a entity is final, i.e. is not anymore overridden. */ -static int is_final_ent(entity *ent) { +static int is_final_ent(ir_entity *ent) { if (get_entity_final(ent)) { /* not possible to override this entity. */ return 1; @@ -102,9 +102,9 @@ static int is_final_ent(entity *ent) { */ ir_node *transform_node_Sel(ir_node *node) { - ir_node *new_node, *ptr; - ir_type *dyn_tp; - entity *ent = get_Sel_entity(node); + ir_node *new_node, *ptr; + ir_type *dyn_tp; + ir_entity *ent = get_Sel_entity(node); if (get_irp_phase_state() == phase_building) return node; @@ -137,7 +137,7 @@ ir_node *transform_node_Sel(ir_node *node) dyn_tp = get_dynamic_type(ptr); /* The runtime type of ptr. */ if (dyn_tp != firm_unknown_type) { - entity *called_ent; + ir_entity *called_ent; ir_node *rem_block; /* We know which method will be called, no dispatch necessary. */ @@ -168,7 +168,7 @@ ir_node *transform_node_Sel(ir_node *node) ir_node *transform_node_Load(ir_node *n) { ir_node *field_ptr, *new_node, *ptr; - entity *ent; + ir_entity *ent; ir_type *dyn_tp; if (!(get_opt_optimize() && get_opt_dyn_meth_dispatch())) @@ -197,7 +197,7 @@ ir_node *transform_node_Load(ir_node *n) dyn_tp = get_dynamic_type(ptr); /* The runtime type of ptr. */ if (dyn_tp != firm_unknown_type) { - entity *loaded_ent; + ir_entity *loaded_ent; /* We know which method will be called, no dispatch necessary. */ loaded_ent = resolve_ent_polymorphy(dyn_tp, ent); diff --git a/ir/opt/proc_cloning.c b/ir/opt/proc_cloning.c index c4fc9257b..21b35891e 100644 --- a/ir/opt/proc_cloning.c +++ b/ir/opt/proc_cloning.c @@ -59,7 +59,7 @@ * decide if this function must be cloned. */ typedef struct quadruple { - entity *ent; /**< The entity of our Call. */ + ir_entity *ent; /**< The entity of our Call. */ int pos; /**< Position of a constant argument of our Call. */ tarval *tv; /**< The tarval of this argument if Const node. */ ir_node **calls; /**< The list of all calls with the same characteristics */ @@ -120,7 +120,7 @@ static void kill_entry(entry_t *entry) { * @param callee The entity of the callee * @param hmap The quadruple-set containing the calls with constant parameters */ -static void process_call(ir_node *call, entity *callee, q_set *hmap) +static void process_call(ir_node *call, ir_entity *callee, q_set *hmap) { ir_type *mtp; entry_t *key, *entry; @@ -184,7 +184,7 @@ static void collect_irg_calls(ir_node *call, void *env) { q_set *hmap = env; ir_node *call_ptr; - entity *callee; + ir_entity *callee; /* We collect just "Call" nodes */ if (is_Call(call)) { @@ -345,7 +345,7 @@ static ir_node *get_irg_arg(ir_graph *irg, int pos) * @param ent The entity of the method that must be cloned. * @param q Our quadruplet. */ -static void create_clone_proc_irg(entity *ent, quad_t *q) +static void create_clone_proc_irg(ir_entity *ent, quad_t *q) { ir_graph *method_irg, *clone_irg; ir_node *arg, *const_arg; @@ -384,7 +384,7 @@ static void create_clone_proc_irg(entity *ent, quad_t *q) * @param ent The entity of the clone. * @param nr A pointer to the counter of clones. **/ -static void change_entity_type(quad_t *q, entity *ent, unsigned *nr) +static void change_entity_type(quad_t *q, ir_entity *ent, unsigned *nr) { ir_type *mtp, *new_mtp, *tp; ident *tp_name; @@ -422,9 +422,9 @@ static void change_entity_type(quad_t *q, entity *ent, unsigned *nr) * * @param q Contains information for the method to clone. */ -static entity *clone_method(quad_t *q) +static ir_entity *clone_method(quad_t *q) { - entity *new_entity; + ir_entity *new_entity; ident *clone_ident; ir_graph *rem; symconst_symbol sym; @@ -469,7 +469,7 @@ static entity *clone_method(quad_t *q) * @param new_entity The entity of the cloned function. * @param pos The position of the replaced parameter of this call. **/ -static ir_node *new_cl_Call(ir_node *call, entity *new_entity, int pos) +static ir_node *new_cl_Call(ir_node *call, ir_entity *new_entity, int pos) { ir_node **in; ir_type *mtp; @@ -504,7 +504,7 @@ static ir_node *new_cl_Call(ir_node *call, entity *new_entity, int pos) * @param cloned_ent The entity of the new function that must be called * from the new Call. */ -static void exchange_calls(quad_t *q, entity *cloned_ent) +static void exchange_calls(quad_t *q, ir_entity *cloned_ent) { int pos = q->pos; ir_node *new_call, *call; @@ -540,7 +540,7 @@ static void reorder_weights(q_set *hmap, float threshold) { entry_t **adr, *p, *entry; int i, len; - entity *callee; + ir_entity *callee; restart: entry = hmap->heavy_uses; @@ -682,7 +682,7 @@ void proc_cloning(float threshold) entry = hmap.heavy_uses; if (entry) { - entity *ent = clone_method(&entry->q); + ir_entity *ent = clone_method(&entry->q); hmap.heavy_uses = entry->next; diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index 340ad66cd..3c823357b 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.c @@ -48,7 +48,7 @@ * accesses like a.b.c[8].d */ typedef union { - entity *ent; + ir_entity *ent; tarval *tv; } path_elem_t; @@ -66,7 +66,7 @@ typedef struct _path_t { #define PATH_SIZE(p) (sizeof(*(p)) + sizeof((p)->path[0]) * ((p)->path_len - 1)) typedef struct _scalars_t { - entity *ent; /**< A entity for scalar replacement. */ + ir_entity *ent; /**< A entity for scalar replacement. */ ir_type *ent_owner; /**< The owner of this entity. */ } scalars_t; @@ -167,7 +167,7 @@ int is_address_taken(ir_node *sel) int i; ir_mode *emode, *mode; ir_node *value; - entity *ent; + ir_entity *ent; if (! is_const_sel(sel)) return 1; @@ -228,7 +228,7 @@ int is_address_taken(ir_node *sel) * @param ent the entity that will be scalar replaced * @param sel a Sel node that selects some fields of this entity */ -static void link_all_leave_sels(entity *ent, ir_node *sel) +static void link_all_leave_sels(ir_entity *ent, ir_node *sel) { int i, n, flag = 1; @@ -300,7 +300,7 @@ static int find_possible_replacements(ir_graph *irg) ir_node *succ = get_irn_out(irg_frame, i); if (is_Sel(succ)) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); set_entity_link(ent, NULL); } } @@ -314,7 +314,7 @@ static int find_possible_replacements(ir_graph *irg) ir_node *succ = get_irn_out(irg_frame, i); if (is_Sel(succ)) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); ir_type *ent_type; if (get_entity_link(ent) == ADDRESS_TAKEN) @@ -402,7 +402,7 @@ static path_t *find_path(ir_node *sel, unsigned len) * * @return the next free value number */ -static unsigned allocate_value_numbers(pset *sels, entity *ent, unsigned vnum, ir_mode ***modes) +static unsigned allocate_value_numbers(pset *sels, ir_entity *ent, unsigned vnum, ir_mode ***modes) { ir_node *sel, *next; path_t *key, *path; @@ -780,7 +780,7 @@ void scalar_replacement_opt(ir_graph *irg) ir_node *succ = get_irn_out(irg_frame, i); if (is_Sel(succ)) { - entity *ent = get_Sel_entity(succ); + ir_entity *ent = get_Sel_entity(succ); if (get_entity_link(ent) == NULL || get_entity_link(ent) == ADDRESS_TAKEN) continue; diff --git a/ir/opt/strength_red.c b/ir/opt/strength_red.c index 0a9ae3a58..0d2352098 100644 --- a/ir/opt/strength_red.c +++ b/ir/opt/strength_red.c @@ -38,10 +38,10 @@ static int n_made_new_phis; * @verbatim * * init - * /|\ + * ^ * | * +-- Phi - * | /|\ + * | ^ * | | * +-->op * @@ -568,12 +568,13 @@ static void reduce_itervar(ir_node *itervar_phi, void *env) /* check if a iteration variable be reduced.*/ int reduced = 0; - if (get_irn_op(itervar_phi) != op_Phi) + if (! is_Phi(itervar_phi)) return; - /* A candidate is found.*/ + + /* A potential candidate is found.*/ ivi.itervar_phi = itervar_phi; - /* It musss be a induction variable.*/ + /* check if it's a induction variable.*/ if (is_induction_variable(&ivi)) { int i, op_out; diff --git a/ir/opt/tailrec.c b/ir/opt/tailrec.c index f9b6e1a29..dc94c88c7 100644 --- a/ir/opt/tailrec.c +++ b/ir/opt/tailrec.c @@ -123,7 +123,7 @@ static void do_opt_tail_rec(ir_graph *irg, ir_node *rets, int n_tail_calls) int i, j, n_params; collect_t data; int rem = get_optimize(); - entity *ent = get_irg_entity(irg); + ir_entity *ent = get_irg_entity(irg); ir_type *method_tp = get_entity_type(ent); assert(n_tail_calls); @@ -313,7 +313,7 @@ int opt_tail_rec_irg(ir_graph *irg) for (i = get_Block_n_cfgpreds(end_block) - 1; i >= 0; --i) { ir_node *ret = get_Block_cfgpred(end_block, i); ir_node *call, *call_ptr; - entity *ent; + ir_entity *ent; int j; ir_node **ress; diff --git a/ir/opt/tropt.c b/ir/opt/tropt.c index a4226154c..6ecd9521b 100644 --- a/ir/opt/tropt.c +++ b/ir/opt/tropt.c @@ -289,7 +289,7 @@ static void cancel_out_casts(ir_node *cast) { static void concretize_selected_entity(ir_node *sel) { ir_node *cast, *ptr = get_Sel_ptr(sel); ir_type *orig_tp, *cast_tp; - entity *new_ent, *sel_ent; + ir_entity *new_ent, *sel_ent; sel_ent = get_Sel_entity(sel); cast = get_Sel_ptr(sel); diff --git a/ir/stat/firmstat.c b/ir/stat/firmstat.c index a81af00b8..0f5ae346c 100644 --- a/ir/stat/firmstat.c +++ b/ir/stat/firmstat.c @@ -712,11 +712,11 @@ static int cnt_const_args(ir_node *call) { */ static void stat_update_call(ir_node *call, graph_entry_t *graph) { - ir_node *block = get_nodes_block(call); - ir_node *ptr = get_Call_ptr(call); - entity *ent = NULL; - ir_graph *callee = NULL; - int num_const_args; + ir_node *block = get_nodes_block(call); + ir_node *ptr = get_Call_ptr(call); + ir_entity *ent = NULL; + ir_graph *callee = NULL; + int num_const_args; /* * If the block is bad, the whole subgraph will collapse later @@ -788,10 +788,10 @@ static void stat_update_call(ir_node *call, graph_entry_t *graph) */ static void stat_update_call_2(ir_node *call, graph_entry_t *graph) { - ir_node *block = get_nodes_block(call); - ir_node *ptr = get_Call_ptr(call); - entity *ent = NULL; - ir_graph *callee = NULL; + ir_node *block = get_nodes_block(call); + ir_node *ptr = get_Call_ptr(call); + ir_entity *ent = NULL; + ir_graph *callee = NULL; /* * If the block is bad, the whole subgraph will collapse later @@ -1342,7 +1342,7 @@ static void stat_turn_into_id(void *ctx, ir_node *node) { * @param irg the new IR graph that was created * @param ent the entity of this graph */ -static void stat_new_graph(void *ctx, ir_graph *irg, entity *ent) { +static void stat_new_graph(void *ctx, ir_graph *irg, ir_entity *ent) { if (! status->stat_options) return; diff --git a/ir/stat/firmstat_t.h b/ir/stat/firmstat_t.h index 64106baf8..dbf36eb48 100644 --- a/ir/stat/firmstat_t.h +++ b/ir/stat/firmstat_t.h @@ -125,7 +125,7 @@ typedef struct _graph_entry_t { unsigned num_tail_recursion; /**< number of tail recursion optimizations */ HASH_MAP(opt_entry_t) *opt_hash[FS_OPT_MAX]; /**< hash maps containing opcode counter for optimizations */ ir_graph *irg; /**< the graph of this object */ - entity *ent; /**< the entity of this graph if one exists */ + ir_entity *ent; /**< the entity of this graph if one exists */ set *address_mark; /**< a set containing the address marks of the nodes */ unsigned is_deleted:1; /**< set if this irg was deleted */ unsigned is_leaf:1; /**< set, if this irg is a leaf function */ diff --git a/ir/tr/entity.h b/ir/tr/entity.h index 06a892dd8..8d5c7d134 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -601,7 +601,7 @@ ir_type *get_entity_repr_class(const ir_entity *ent); extern ir_entity *unknown_entity; /** Returns the unknown entity */ -entity *get_unknown_entity(void); +ir_entity *get_unknown_entity(void); /** Encodes how a pointer parameter is accessed. */ typedef enum acc_bits { diff --git a/ir/tr/mangle.c b/ir/tr/mangle.c index 8873c79b5..438100779 100644 --- a/ir/tr/mangle.c +++ b/ir/tr/mangle.c @@ -37,7 +37,7 @@ mangle_type (ir_type *tp) } ident * -mangle_entity (entity *ent) +mangle_entity (ir_entity *ent) { ident *type_id; char *cp; @@ -114,7 +114,7 @@ ident *mangle_dot (ident *first, ident* scnd) { } /* returns a mangled name for a Win32 function using it's calling convention */ -ident *decorate_win32_c_fkt(entity *ent) { +ident *decorate_win32_c_fkt(ir_entity *ent) { ir_type *tp = get_entity_type(ent); unsigned cc_mask = get_method_calling_convention(tp); char buf[16]; diff --git a/ir/tr/mangle.h b/ir/tr/mangle.h index 892bdba1f..3ef759a23 100644 --- a/ir/tr/mangle.h +++ b/ir/tr/mangle.h @@ -21,8 +21,8 @@ #ifndef _MANGLE_H_ #define _MANGLE_H_ -# include "ident.h" -# include "entity.h" +#include "ident.h" +#include "entity.h" /** initializes the name mangling code */ void firm_init_mangle (void); @@ -30,7 +30,7 @@ void firm_init_mangle (void); /** 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 (entity *ent); +ident *mangle_entity (ir_entity *ent); /** mangle underscore: Returns a new ident that represents first_scnd. */ ident *mangle_u (ident *first, ident* scnd); @@ -42,6 +42,6 @@ ident *mangle_dot (ident *first, ident* scnd); ident *mangle (ident *first, ident* scnd); /** returns a mangled name for a Win32 function using it's calling convention */ -ident *decorate_win32_c_fkt(entity *ent); +ident *decorate_win32_c_fkt(ir_entity *ent); #endif /* _MANGLE_H_ */ diff --git a/ir/tr/tpop_t.h b/ir/tr/tpop_t.h index e3e4cc901..234ce0a83 100644 --- a/ir/tr/tpop_t.h +++ b/ir/tr/tpop_t.h @@ -46,12 +46,12 @@ typedef void (*set_type_size_func)(ir_type *tp, int size); typedef int (*get_n_members_func)(const ir_type *tp); /** A function called to get the pos'th compound member */ -typedef entity *(*get_member_func)(const ir_type *tp, int pos); +typedef ir_entity *(*get_member_func)(const ir_type *tp, int pos); -typedef int (*get_member_index_func)(const ir_type *tp, entity *member); +typedef int (*get_member_index_func)(const ir_type *tp, ir_entity *member); /** A function called to insert an entity into the type */ -typedef void (*insert_entity_func)(ir_type *tp, entity *member); +typedef void (*insert_entity_func)(ir_type *tp, ir_entity *member); /** * tp_op operations. diff --git a/ir/tr/tr_inheritance.c b/ir/tr/tr_inheritance.c index 161f7d32a..b8656dd16 100644 --- a/ir/tr/tr_inheritance.c +++ b/ir/tr/tr_inheritance.c @@ -38,7 +38,7 @@ /* Resolve implicit inheritance. */ /* ----------------------------------------------------------------------- */ -ident *default_mangle_inherited_name(entity *super, ir_type *clss) { +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))); } @@ -49,7 +49,7 @@ static void copy_entities_from_superclass(ir_type *clss, void *env) int i, j, k, l; int overwritten; ir_type *super, *inhenttype; - entity *inhent, *thisent; + ir_entity *inhent, *thisent; mangle_inherited_name_func *mfunc = *(mangle_inherited_name_func **)env; for(i = 0; i < get_class_n_supertypes(clss); i++) { @@ -176,7 +176,7 @@ static tr_inh_trans_tp* get_firm_kind_entry(firm_kind *k) { return found; } -static pset *get_entity_map(entity *ent, dir d) { +static pset *get_entity_map(ir_entity *ent, dir d) { tr_inh_trans_tp *found; assert(is_entity(ent)); @@ -184,7 +184,7 @@ static pset *get_entity_map(entity *ent, dir d) { return found->directions[d]; } /* -static void add_entity_map(entity *ent, dir d, entity *new) { +static void add_entity_map(ir_entity *ent, dir d, ir_entity *new) { tr_inh_trans_tp *found; assert(is_entity(ent) && is_entity(new)); @@ -256,12 +256,12 @@ static void compute_down_closure(ir_type *tp) { /* entities */ n_members = get_class_n_members(tp); for (i = 0; i < n_members; ++i) { - entity *mem = get_class_member(tp, i); + ir_entity *mem = get_class_member(tp, i); int j, n_overwrittenby = get_entity_n_overwrittenby(mem); myset = get_entity_map(mem, d_down); for (j = 0; j < n_overwrittenby; ++j) { - entity *ov = get_entity_overwrittenby(mem, j); + ir_entity *ov = get_entity_overwrittenby(mem, j); subset = get_entity_map(ov, d_down); pset_insert_ptr(myset, ov); pset_insert_pset_ptr(myset, subset); @@ -310,12 +310,12 @@ static void compute_up_closure(ir_type *tp) { /* entities */ n_members = get_class_n_members(tp); for (i = 0; i < n_members; ++i) { - entity *mem = get_class_member(tp, i); + ir_entity *mem = get_class_member(tp, i); int j, n_overwrites = get_entity_n_overwrites(mem); myset = get_entity_map(mem, d_up); for (j = 0; j < n_overwrites; ++j) { - entity *ov = get_entity_overwrites(mem, j); + ir_entity *ov = get_entity_overwrites(mem, j); subset = get_entity_map(ov, d_up); pset_insert_pset_ptr(myset, subset); pset_insert_ptr(myset, ov); @@ -439,12 +439,12 @@ ir_type *get_class_trans_supertype_next (ir_type *tp) { /* - overwrittenby ------------------------------------------------------- */ -entity *get_entity_trans_overwrittenby_first(entity *ent) { +ir_entity *get_entity_trans_overwrittenby_first(ir_entity *ent) { assert_valid_state(); return pset_first(get_entity_map(ent, d_down)); } -entity *get_entity_trans_overwrittenby_next (entity *ent) { +ir_entity *get_entity_trans_overwrittenby_next (ir_entity *ent) { assert_valid_state(); return pset_next(get_entity_map(ent, d_down)); } @@ -453,12 +453,12 @@ entity *get_entity_trans_overwrittenby_next (entity *ent) { /** Iterate over all transitive overwritten entities. */ -entity *get_entity_trans_overwrites_first(entity *ent) { +ir_entity *get_entity_trans_overwrites_first(ir_entity *ent) { assert_valid_state(); return pset_first(get_entity_map(ent, d_up)); } -entity *get_entity_trans_overwrites_next (entity *ent) { +ir_entity *get_entity_trans_overwrites_next (ir_entity *ent) { assert_valid_state(); return pset_next(get_entity_map(ent, d_up)); } @@ -512,7 +512,7 @@ int is_SubClass_ptr_of(ir_type *low, ir_type *high) { return 0; } -int is_overwritten_by(entity *high, entity *low) { +int is_overwritten_by(ir_entity *high, ir_entity *low) { int i, n_overwrittenby; assert(is_entity(low) && is_entity(high)); @@ -524,7 +524,7 @@ int is_overwritten_by(entity *high, entity *low) { /* depth first search from high downwards. */ n_overwrittenby = get_entity_n_overwrittenby(high); for (i = 0; i < n_overwrittenby; i++) { - entity *ov = get_entity_overwrittenby(high, i); + ir_entity *ov = get_entity_overwrittenby(high, i); if (low == ov) return 1; if (is_overwritten_by(low, ov)) return 1; @@ -540,14 +540,14 @@ int is_overwritten_by(entity *high, entity *low) { * * Need two routines because I want to assert the result. */ -static entity *do_resolve_ent_polymorphy(ir_type *dynamic_class, entity *static_ent) { +static ir_entity *do_resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *static_ent) { int i, n_overwrittenby; if (get_entity_owner(static_ent) == dynamic_class) return static_ent; n_overwrittenby = get_entity_n_overwrittenby(static_ent); for (i = 0; i < n_overwrittenby; ++i) { - entity *ent = get_entity_overwrittenby(static_ent, i); + ir_entity *ent = get_entity_overwrittenby(static_ent, i); ent = do_resolve_ent_polymorphy(dynamic_class, ent); if (ent) return ent; } @@ -559,8 +559,8 @@ static entity *do_resolve_ent_polymorphy(ir_type *dynamic_class, entity *static_ * Returns the dynamically referenced entity if the static entity and the * dynamic type are given. * Search downwards in overwritten tree. */ -entity *resolve_ent_polymorphy(ir_type *dynamic_class, entity *static_ent) { - entity *res; +ir_entity *resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity *static_ent) { + ir_entity *res; assert(static_ent && is_entity(static_ent)); res = do_resolve_ent_polymorphy(dynamic_class, static_ent); diff --git a/ir/tr/tr_inheritance.h b/ir/tr/tr_inheritance.h index 5395966b3..bc6cbb369 100644 --- a/ir/tr/tr_inheritance.h +++ b/ir/tr/tr_inheritance.h @@ -70,14 +70,14 @@ int is_SubClass_ptr_of(ir_type *low, ir_type *high); /** Returns true if high is (transitive) overwritten by low. * * Returns false if high == low. */ -int is_overwritten_by(entity *high, entity *low); +int is_overwritten_by(ir_entity *high, ir_entity *low); /** Resolve polymorphism in the inheritance relation. * * Returns the dynamically referenced entity if the static entity and the * dynamic type are given. * Searches downwards in overwritten tree. */ -entity *resolve_ent_polymorphy(ir_type *dynamic_class, entity* static_ent); +ir_entity *resolve_ent_polymorphy(ir_type *dynamic_class, ir_entity* static_ent); /* ----------------------------------------------------------------------- */ /* Resolve implicit inheritance. */ @@ -87,7 +87,7 @@ entity *resolve_ent_polymorphy(ir_type *dynamic_class, entity* static_ent); * * Returns an ident that consists of the name of type followed by an * underscore and the name (not ld_name) of the entity. */ -ident *default_mangle_inherited_name(entity *ent, ir_type *clss); +ident *default_mangle_inherited_name(ir_entity *ent, ir_type *clss); /** Type of argument functions for inheritance resolver. * @@ -96,7 +96,7 @@ ident *default_mangle_inherited_name(entity *ent, ir_type *clss); * used. * @param clss The class type in which the new entity will be placed. */ -typedef ident *mangle_inherited_name_func(entity *ent, ir_type *clss); +typedef ident *mangle_inherited_name_func(ir_entity *ent, ir_type *clss); /** Resolve implicit inheritance. * @@ -175,14 +175,14 @@ ir_type *get_class_trans_supertype_next (ir_type *tp); /* - overwrittenby ------------------------------------------------------- */ /** Iterate over all entities that transitive overwrite this entities. */ -entity *get_entity_trans_overwrittenby_first(entity *ent); -entity *get_entity_trans_overwrittenby_next (entity *ent); +ir_entity *get_entity_trans_overwrittenby_first(ir_entity *ent); +ir_entity *get_entity_trans_overwrittenby_next (ir_entity *ent); /* - overwrites ---------------------------------------------------------- */ /** Iterate over all transitive overwritten entities. */ -entity *get_entity_trans_overwrites_first(entity *ent); -entity *get_entity_trans_overwrites_next (entity *ent); +ir_entity *get_entity_trans_overwrites_first(ir_entity *ent); +ir_entity *get_entity_trans_overwrites_next (ir_entity *ent); /* ----------------------------------------------------------------------- */ diff --git a/ir/tr/trvrfy.c b/ir/tr/trvrfy.c index 80e1752f8..ae02baedd 100644 --- a/ir/tr/trvrfy.c +++ b/ir/tr/trvrfy.c @@ -68,7 +68,7 @@ do { \ * Show diagnostic if an entity overwrites another one not * in direct superclasses. */ -static void show_ent_not_supertp(entity *ent, entity *ovw) +static void show_ent_not_supertp(ir_entity *ent, ir_entity *ovw) { ir_type *owner = get_entity_owner(ent); ir_type *ov_own = get_entity_owner(ovw); @@ -88,7 +88,7 @@ static void show_ent_not_supertp(entity *ent, entity *ovw) /** * Show diagnostic if an entity overwrites a wrong number of things. */ -static void show_ent_overwrite_cnt(entity *ent) +static void show_ent_overwrite_cnt(ir_entity *ent) { ir_type *owner = get_entity_owner(ent); int i, j, k, found, show_stp = 0; @@ -96,7 +96,7 @@ static void show_ent_overwrite_cnt(entity *ent) fprintf(stderr, "Type verification error:\n"); ir_fprintf(stderr, "Entity %t::%e owerwrites\n", owner, ent); for (i = 0; i < get_entity_n_overwrites(ent); ++i) { - entity *ovw = get_entity_overwrites(ent, i); + ir_entity *ovw = get_entity_overwrites(ent, i); ir_type *ov_own = get_entity_owner(ovw); ir_fprintf(stderr, " %t::%e\n", ov_own, ovw); @@ -136,7 +136,7 @@ static int check_class(ir_type *tp) { /*printf("\n"); DDMT(tp);*/ for (i = get_class_n_members(tp) - 1; i >= 0; --i) { - entity *mem = get_class_member(tp, i); + ir_entity *mem = get_class_member(tp, i); ASSERT_AND_RET_DBG( tp == get_entity_owner(mem), @@ -159,7 +159,7 @@ static int check_class(ir_type *tp) { ); for (j = get_entity_n_overwrites(mem) - 1; j >= 0; --j) { - entity *ovw = get_entity_overwrites(mem, j); + ir_entity *ovw = get_entity_overwrites(mem, j); /*printf(" overwrites: "); DDME(ovw);*/ /* Check whether ovw is member of one of tp's supertypes. If so, the representation is correct. */ @@ -283,7 +283,7 @@ static int constant_on_wrong_irg(ir_node *n) { * @return NON-zero if an entity initializer constant is NOT on * the current_ir_graph's obstack. */ -static int constants_on_wrong_irg(entity *ent) { +static int constants_on_wrong_irg(ir_entity *ent) { if (get_entity_variability(ent) == variability_uninitialized) return 0; if (is_compound_entity(ent)) { @@ -312,7 +312,7 @@ static int constants_on_wrong_irg(entity *ent) { /** * Shows a wrong entity allocation */ -static void show_ent_alloc_error(entity *ent) +static void show_ent_alloc_error(ir_entity *ent) { ir_fprintf(stderr, "%+e owner %t has allocation %s\n", ent, get_entity_type(ent), @@ -327,7 +327,7 @@ static void show_ent_alloc_error(entity *ent) * 0 if no error encountered * != 0 a trvrfy_error_codes code */ -int check_entity(entity *ent) { +int check_entity(ir_entity *ent) { int rem_vpi; ir_type *tp = get_entity_type(ent); ir_type *owner = get_entity_owner(ent); @@ -359,7 +359,7 @@ int check_entity(entity *ent) { doing the test. */ if (get_entity_peculiarity(ent) == peculiarity_inherited) { if (is_Method_type(get_entity_type(ent))) { - entity *impl = get_SymConst_entity(get_atomic_ent_value(ent)); + ir_entity *impl = get_SymConst_entity(get_atomic_ent_value(ent)); ASSERT_AND_RET_DBG( get_entity_peculiarity(impl) == peculiarity_existent, "inherited method entities must have constant pointing to existent entity.", @@ -406,7 +406,7 @@ static void check_tore(type_or_ent *tore, void *env) { *res = check_type((ir_type *)tore); } else { assert(is_entity(tore)); - *res = check_entity((entity *)tore); + *res = check_entity((ir_entity *)tore); } } diff --git a/ir/tr/trvrfy.h b/ir/tr/trvrfy.h index 2e3e15666..cbb0ec649 100644 --- a/ir/tr/trvrfy.h +++ b/ir/tr/trvrfy.h @@ -59,7 +59,7 @@ int check_type(ir_type *tp); * 0 if no error encountered * != 0 a trvrfy_error_codes code */ -int check_entity(entity *ent); +int check_entity(ir_entity *ent); /** * Walks the type information and performs a set of sanity checks. diff --git a/ir/tr/type_or_entity.h b/ir/tr/type_or_entity.h index 54de00b87..ecdd5edb4 100644 --- a/ir/tr/type_or_entity.h +++ b/ir/tr/type_or_entity.h @@ -25,8 +25,8 @@ /** A data type to treat types and entities as the same. */ typedef union { - ir_type *typ; /**< points to a type */ - entity *ent; /**< points to an entity */ + ir_type *typ; /**< points to a type */ + ir_entity *ent; /**< points to an entity */ } type_or_ent; diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index 94df384b4..5e576921d 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -38,25 +38,25 @@ enum class_flags { /** Class type attributes. */ typedef struct { - entity **members; /**< Array containing the fields and methods of this class. */ + ir_entity **members; /**< Array containing the fields and methods of this class. */ ir_type **subtypes; /**< Array containing the direct subtypes. */ ir_type **supertypes; /**< Array containing the direct supertypes */ ir_peculiarity peculiarity; /**< The peculiarity of this class. */ - entity *type_info; /**< An entity representing this class, used for type info. */ - int dfn; /**< A number that can be used for 'instanceof' operator. */ + ir_entity *type_info; /**< An ir_entity representing this class, used for type info. */ + int dfn; /**< A number that can be used for 'instanceof' operator. */ unsigned vtable_size; /**< The size of the vtable for this class. */ unsigned clss_flags; /**< Additional class flags. */ } cls_attr; /** Struct type attributes. */ typedef struct { - entity **members; /**< Fields of this struct. No method entities allowed. */ + ir_entity **members; /**< Fields of this struct. No method entities allowed. */ } stc_attr; -/** A (type, entity) pair. */ +/** A (type, ir_entity) pair. */ typedef struct { ir_type *tp; /**< A type. */ - entity *ent; /**< An entity. */ + ir_entity *ent; /**< An ir_entity. */ ident *param_name; /**< For debugging purposes: the name of the parameter */ } tp_ent_pair; @@ -66,7 +66,7 @@ typedef struct { tp_ent_pair *params; /**< Array of parameter type/value entities pairs. */ ir_type *value_params; /**< A type whose entities represent copied value arguments. */ int n_res; /**< Number of results. */ - tp_ent_pair *res_type; /**< Array of result type/value entity pairs. */ + tp_ent_pair *res_type; /**< Array of result type/value ir_entity pairs. */ ir_type *value_ress; /**< A type whose entities represent copied value results. */ variadicity variadicity; /**< The variadicity of the method. */ int first_variadic_param; /**< The index of the first variadic parameter or -1 if non-variadic .*/ @@ -76,7 +76,7 @@ typedef struct { /** Union type attributes. */ typedef struct { - entity **members; /**< Fields of this union. No method entities allowed. */ + ir_entity **members; /**< Fields of this union. No method entities allowed. */ } uni_attr; /** Array type attributes. */ @@ -86,7 +86,7 @@ typedef struct { ir_node **upper_bound; /**< Upper bounds or dimensions. */ int *order; /**< Ordering of dimensions. */ ir_type *element_type; /**< The type of the array elements. */ - entity *element_ent; /**< Entity for the array elements, to be used for + ir_entity *element_ent; /**< entity for the array elements, to be used for element selection with a Sel node. */ } arr_attr; @@ -105,7 +105,7 @@ typedef struct { /** Pointer type attributes. */ typedef struct { - ir_type *points_to; /**< The type of the entity the pointer points to. */ + ir_type *points_to; /**< The type of the ir_entity the pointer points to. */ } ptr_attr; /* @@ -147,10 +147,10 @@ struct ir_type { ident *name; /**< The name of the type */ ir_visibility visibility;/**< Visibility of entities of this type. */ unsigned flags; /**< Type flags, a bitmask of enum type_flags. */ - int size; /**< Size of an entity of this type. This is determined + int size; /**< Size of an ir_entity of this type. This is determined when fixing the layout of this class. Size must be given in bits. */ - int align; /**< Alignment of an entity of this type. This should be + int align; /**< Alignment of an ir_entity of this type. This should be set according to the source language needs. If not set it's calculated automatically by get_type_alignment(). Alignment must be given in bits. */ @@ -354,7 +354,7 @@ _get_class_n_members (const ir_type *clss) { return (ARR_LEN (clss->attr.ca.members)); } -static INLINE entity * +static INLINE ir_entity * _get_class_member (const ir_type *clss, int pos) { assert(clss && (clss->type_op == type_class)); assert(pos >= 0 && pos < _get_class_n_members(clss)); diff --git a/ir/tr/typewalk.c b/ir/tr/typewalk.c index 99bcdd466..cd3db9684 100644 --- a/ir/tr/typewalk.c +++ b/ir/tr/typewalk.c @@ -62,15 +62,15 @@ static void do_type_walk(type_or_ent *tore, type_walk_func *post, void *env) { - int i, n_types, n_mem; - entity *ent = NULL; - ir_type *tp = NULL; - ir_node *n; + int i, n_types, n_mem; + ir_entity *ent = NULL; + ir_type *tp = NULL; + ir_node *n; /* marked? */ switch (get_kind(tore)) { case k_entity: - ent = (entity *)tore; + ent = (ir_entity *)tore; if (entity_visited(ent)) return; break; case k_type: @@ -192,7 +192,7 @@ static void do_type_walk(type_or_ent *tore, static void irn_type_walker( ir_node *node, type_walk_func *pre, type_walk_func *post, void *env) { - entity *ent; + ir_entity *ent; ir_type *tp; assert(node); @@ -277,7 +277,7 @@ static void type_walk_s2s_2(type_or_ent *tore, /* marked? */ switch (get_kind(tore)) { case k_entity: - if (entity_visited((entity *)tore)) return; + if (entity_visited((ir_entity *)tore)) return; break; case k_type: if (type_id == get_type_tpop((ir_type*)tore)) { @@ -374,7 +374,7 @@ type_walk_super_2(type_or_ent *tore, /* marked? */ switch (get_kind(tore)) { case k_entity: - if (entity_visited((entity *)tore)) return; + if (entity_visited((ir_entity *)tore)) return; break; case k_type: if (type_id == get_type_tpop((ir_type*)tore)) { @@ -517,7 +517,7 @@ void class_walk_super2sub( /* Walks over all entities in the type */ void walk_types_entities( ir_type *tp, - void (*doit)(entity*, void*), + void (*doit)(ir_entity*, void*), void *env) { int i, n; diff --git a/ir/tr/typewalk.h b/ir/tr/typewalk.h index e5524733e..abbe08b72 100644 --- a/ir/tr/typewalk.h +++ b/ir/tr/typewalk.h @@ -110,7 +110,7 @@ void class_walk_super2sub(class_walk_func *pre, * @param ent points to the visited entity * @param env free environment pointer */ -typedef void entity_walk_func(entity *ent, void *env); +typedef void entity_walk_func(ir_entity *ent, void *env); /** * Walks over all entities in the type. -- 2.20.1