From 9ab9464c184c44e526fe3ec43012070bd0fccfe5 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 13 Jan 2006 21:54:03 +0000 Subject: [PATCH] renamed all types 'type' to 'ir_type' [r7230] --- ir/ana/cgana.c | 4 +- ir/ana/field_temperature.c | 22 +++++----- ir/ana/irconsconfirm.c | 2 +- ir/ana/irsimpletype.c | 36 ++++++++-------- ir/ana/irtypeinfo.c | 10 ++--- ir/ana/rta.c | 13 +++--- ir/ana/rta.h | 5 ++- ir/ana/trouts.c | 86 +++++++++++++++++++------------------- ir/ana/trouts.h | 26 ++++++------ ir/ana2/typalise.c | 59 +++++++++++++------------- ir/ana2/typalise.h | 5 ++- ir/common/statistics.c | 2 +- 12 files changed, 141 insertions(+), 129 deletions(-) diff --git a/ir/ana/cgana.c b/ir/ana/cgana.c index b4b051201..f04010249 100644 --- a/ir/ana/cgana.c +++ b/ir/ana/cgana.c @@ -483,7 +483,7 @@ static void free_ana_walker(ir_node *node, void *env) { static void add_method_address(entity *ent, eset *set) { ir_node *n; - type *tp; + ir_type *tp; int i; /* do not check uninitialized values */ @@ -542,7 +542,7 @@ static entity ** get_free_methods(void) entity **arr = NEW_ARR_F(entity *, 0); entity *ent; ir_graph *irg; - type *glob; + ir_type *glob; for (i = get_irp_n_irgs() - 1; i >= 0; --i) { irg = get_irp_irg(i); diff --git a/ir/ana/field_temperature.c b/ir/ana/field_temperature.c index 39593be32..fc147cd7d 100644 --- a/ir/ana/field_temperature.c +++ b/ir/ana/field_temperature.c @@ -106,7 +106,7 @@ double get_irn_final_cost(ir_node *n) { return cost_loop*(cost_method + cost_rec); } -double get_type_estimated_n_instances(type *tp) { +double get_type_estimated_n_instances(ir_type *tp) { int i, n_allocs = get_type_n_allocs(tp); double n_instances = 0; for (i = 0; i < n_allocs; ++i) { @@ -116,12 +116,12 @@ double get_type_estimated_n_instances(type *tp) { return n_instances; } -double get_type_estimated_mem_consumption_bytes(type *tp) { +double get_type_estimated_mem_consumption_bytes(ir_type *tp) { assert(0); return 0.0; } -int get_type_estimated_n_fields(type *tp) { +int get_type_estimated_n_fields(ir_type *tp) { int s = 0; switch(get_type_tpop_code(tp)) { @@ -160,7 +160,7 @@ int get_type_estimated_n_fields(type *tp) { return s; } -int get_type_estimated_size_bytes(type *tp) { +int get_type_estimated_size_bytes(ir_type *tp) { int s = 0; switch(get_type_tpop_code(tp)) { @@ -203,7 +203,7 @@ int get_type_estimated_size_bytes(type *tp) { return s; } -double get_type_estimated_n_casts(type *tp) { +double get_type_estimated_n_casts(ir_type *tp) { int i, n_casts = get_type_n_casts(tp); double n_instances = 0; for (i = 0; i < n_casts; ++i) { @@ -213,7 +213,7 @@ double get_type_estimated_n_casts(type *tp) { return n_instances; } -double get_class_estimated_n_upcasts(type *clss) { +double get_class_estimated_n_upcasts(ir_type *clss) { double n_instances = 0; int i, j, n_casts, n_pointertypes; @@ -234,7 +234,7 @@ double get_class_estimated_n_upcasts(type *clss) { return n_instances; } -double get_class_estimated_n_downcasts(type *clss) { +double get_class_estimated_n_downcasts(ir_type *clss) { double n_instances = 0; int i, j, n_casts, n_pointertypes; @@ -256,12 +256,12 @@ double get_class_estimated_n_downcasts(type *clss) { } -double get_class_estimated_dispatch_writes(type *clss) { +double get_class_estimated_dispatch_writes(ir_type *clss) { return get_type_estimated_n_instances(clss); } /** Returns the number of reads of the dispatch pointer. */ -double get_class_estimated_dispatch_reads (type *clss) { +double get_class_estimated_dispatch_reads (ir_type *clss) { int i, n_mems = get_class_n_members(clss); double n_calls = 0; for (i = 0; i < n_mems; ++i) { @@ -271,7 +271,7 @@ double get_class_estimated_dispatch_reads (type *clss) { return n_calls; } -double get_class_estimated_n_dyncalls(type *clss) { +double get_class_estimated_n_dyncalls(ir_type *clss) { return get_class_estimated_dispatch_reads(clss) + get_class_estimated_dispatch_writes(clss); } @@ -360,7 +360,7 @@ int is_jack_rts_name(ident *name) { } -int is_jack_rts_class(type *t) { +int is_jack_rts_class(ir_type *t) { ident *name = get_type_ident(t); return is_jack_rts_name(name); } diff --git a/ir/ana/irconsconfirm.c b/ir/ana/irconsconfirm.c index 75131fc0b..383084949 100644 --- a/ir/ana/irconsconfirm.c +++ b/ir/ana/irconsconfirm.c @@ -71,7 +71,7 @@ static void handle_case(ir_node *block, ir_node *irn, long nr, env_t *env) if (! c) { ir_mode *mode = get_irn_mode(irn); - type *tp = get_irn_type(irn); + ir_type *tp = get_irn_type(irn); tarval *tv = new_tarval_from_long(nr, mode); c = new_r_Const_type(current_ir_graph, block, mode, tv, tp); } diff --git a/ir/ana/irsimpletype.c b/ir/ana/irsimpletype.c index 610e96fc5..c5bf3c5ac 100644 --- a/ir/ana/irsimpletype.c +++ b/ir/ana/irsimpletype.c @@ -33,7 +33,7 @@ #define VERBOSE_UNKNOWN_TYPE(s) printf s -static type *phi_cycle_type = NULL; +static ir_type *phi_cycle_type = NULL; /* ------------ Building and Removing the type information ----------- */ @@ -52,7 +52,7 @@ static void precompute_pointer_types(void) { set_type_link(get_irp_type(i), (void *)firm_unknown_type); for (i = get_irp_n_types() - 1; i >= 0; --i) { - type *tp = get_irp_type(i); + ir_type *tp = get_irp_type(i); if (is_Pointer_type(tp)) set_type_link(get_pointer_points_to_type(tp), (void *)tp); } @@ -65,9 +65,9 @@ static void precompute_pointer_types(void) { * Returns a pointer to type which was stored in the link field * to speed up search. */ -static type *find_pointer_type_to (type *tp) { +static ir_type *find_pointer_type_to (ir_type *tp) { #if 0 - return (type *)get_type_link(tp); + return (ir_type *)get_type_link(tp); #else if (get_type_n_pointertypes_to(tp) > 0) return get_type_pointertype_to(tp, 0); @@ -76,10 +76,10 @@ static type *find_pointer_type_to (type *tp) { #endif } -static type *compute_irn_type(ir_node *n); +static ir_type *compute_irn_type(ir_node *n); -static type *find_type_for_Proj(ir_node *n) { - type *tp; +static ir_type *find_type_for_Proj(ir_node *n) { + ir_type *tp; /* Avoid nested Tuples. */ ir_node *pred = skip_Tuple(get_Proj_pred(n)); @@ -99,10 +99,10 @@ static type *find_type_for_Proj(ir_node *n) { assert(get_irn_mode(pred) == mode_T); pred_pred = get_Proj_pred(pred); if (get_irn_op(pred_pred) == op_Start) { - type *mtp = get_entity_type(get_irg_entity(get_irn_irg(pred_pred))); + ir_type *mtp = get_entity_type(get_irg_entity(get_irn_irg(pred_pred))); tp = get_method_param_type(mtp, get_Proj_proj(n)); } else if (get_irn_op(pred_pred) == op_Call) { - type *mtp = get_Call_type(pred_pred); + ir_type *mtp = get_Call_type(pred_pred); tp = get_method_res_type(mtp, get_Proj_proj(n)); } else if (get_irn_op(pred_pred) == op_Tuple) { assert(0 && "Encountered nested Tuple"); @@ -149,9 +149,9 @@ static type *find_type_for_Proj(ir_node *n) { * Try to determine the type of a node. * If a type cannot be determined, return @p firm_none_type. */ -static type *find_type_for_node(ir_node *n) { - type *tp = NULL; - type *tp1 = NULL, *tp2 = NULL; +static ir_type *find_type_for_node(ir_node *n) { + ir_type *tp = NULL; + ir_type *tp1 = NULL, *tp2 = NULL; ir_node *a = NULL, *b = NULL; /* DDMN(n); */ @@ -178,10 +178,10 @@ static type *find_type_for_node(ir_node *n) { /* Check returned type. */ /* int i; - type *meth_type = get_entity_type(get_irg_entity(current_ir_graph)); + ir_type *meth_type = get_entity_type(get_irg_entity(current_ir_graph)); for (i = 0; i < get_method_n_ress(meth_type); i++) { - type *res_type = get_method_res_type(meth_type, i); - type *ana_res_type = get_irn_type(get_Return_res(n, i)); + ir_type *res_type = get_method_res_type(meth_type, i); + ir_type *ana_res_type = get_irn_type(get_Return_res(n, i)); if (ana_res_type == firm_unknown_type) continue; if (res_type != ana_res_type && "return value has wrong type") { DDMN(n); @@ -361,8 +361,8 @@ default_code: { } -static type *compute_irn_type(ir_node *n) { - type *tp = get_irn_typeinfo_type(n); +static ir_type *compute_irn_type(ir_node *n) { + ir_type *tp = get_irn_typeinfo_type(n); if (tp == initial_type) { tp = find_type_for_node(n); @@ -376,7 +376,7 @@ static type *compute_irn_type(ir_node *n) { static void compute_type(ir_node *n, void *env) { - type *tp = get_irn_typeinfo_type(n); + ir_type *tp = get_irn_typeinfo_type(n); if (tp == phi_cycle_type) { /* printf(" recomputing for phi_cycle_type "); DDMN(n); */ set_irn_typeinfo_type(n, initial_type); diff --git a/ir/ana/irtypeinfo.c b/ir/ana/irtypeinfo.c index 80ae38d34..fa79546e6 100644 --- a/ir/ana/irtypeinfo.c +++ b/ir/ana/irtypeinfo.c @@ -50,7 +50,7 @@ static pmap *type_node_map = NULL; * variable is set by init_irtypeinfo. The type is freed by * free_irtypeinfo. */ -type *initial_type = NULL; +ir_type *initial_type = NULL; /* ------------ Initializing this module. ----------------------------- */ @@ -135,18 +135,18 @@ void set_irp_typeinfo_inconsistent(void) { * ir_typeinfo_consistent or ir_typeinfo_inconsistent. They * assume current_ir_graph set properly. */ -type *get_irn_typeinfo_type(ir_node *n) { - type *res = initial_type; +ir_type *get_irn_typeinfo_type(ir_node *n) { + ir_type *res = initial_type; assert(get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_consistent || get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_inconsistent ); if (pmap_contains(type_node_map, (void *)n)) - res = (type *) pmap_get(type_node_map, (void *)n); + res = (ir_type *) pmap_get(type_node_map, (void *)n); return res; } -void set_irn_typeinfo_type(ir_node *n, type *tp) { +void set_irn_typeinfo_type(ir_node *n, ir_type *tp) { assert(get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_consistent || get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_inconsistent ); diff --git a/ir/ana/rta.c b/ir/ana/rta.c index 5d22d385c..81397600d 100644 --- a/ir/ana/rta.c +++ b/ir/ana/rta.c @@ -101,7 +101,7 @@ static int add_graph (ir_graph *graph) return (FALSE); } -static int add_class (type *clazz) +static int add_class (ir_type *clazz) { if (!eset_contains (_live_classes, clazz)) { if (verbose > 1) { @@ -201,7 +201,7 @@ static void rta_act (ir_node *node, void *env) } } else if (iro_Alloc == op) { /* ALLOC */ - type *type = get_Alloc_type (node); + ir_type *type = get_Alloc_type (node); *change |= add_class (type); } @@ -359,7 +359,7 @@ static void init_tables (void) /* Find static allocated classes */ for (i = 0; i < n_globs; ++i) { - type *member_type = get_entity_type(get_class_member(get_glob_type(), i)); + ir_type *member_type = get_entity_type(get_class_member(get_glob_type(), i)); if (is_Class_type(member_type)) eset_insert(_live_classes, member_type); } @@ -500,7 +500,7 @@ void rta_cleanup (void) } /* Say whether this class might be instantiated at any point in the program: */ -int rta_is_alive_class (type *clazz) +int rta_is_alive_class (ir_type *clazz) { return (eset_contains (_live_classes, clazz)); } @@ -517,7 +517,7 @@ void rta_report (void) int i; for (i = 0; i < get_irp_n_types(); ++i) { - type *tp = get_irp_type(i); + ir_type *tp = get_irp_type(i); if (is_Class_type(tp) && rta_is_alive_class(tp)) { fprintf(stdout, "RTA: considered allocated: "); DDMT(tp); } @@ -534,6 +534,9 @@ void rta_report (void) /* * $Log$ + * Revision 1.35 2006/01/13 21:51:59 beck + * renamed all types 'type' to 'ir_type' + * * Revision 1.34 2006/01/02 15:01:16 beck * missing include added * diff --git a/ir/ana/rta.h b/ir/ana/rta.h index 60e024c32..bad8b04c5 100644 --- a/ir/ana/rta.h +++ b/ir/ana/rta.h @@ -53,7 +53,7 @@ void rta_delete_dead_graphs (void); void rta_cleanup(void); /** Returns non-zero if the given class is alive. */ -int rta_is_alive_class(type *clazz); +int rta_is_alive_class(ir_type *clazz); /** Returns non-zero if the given graph is alive. */ int rta_is_alive_graph(ir_graph *graph); @@ -65,6 +65,9 @@ void rta_report (void); /* * $Log$ + * Revision 1.14 2006/01/13 21:52:00 beck + * renamed all types 'type' to 'ir_type' + * * Revision 1.13 2004/10/21 07:23:34 goetz * comments * diff --git a/ir/ana/trouts.c b/ir/ana/trouts.c index f8ecfc5f1..229333c0e 100644 --- a/ir/ana/trouts.c +++ b/ir/ana/trouts.c @@ -68,7 +68,7 @@ void set_entity_reference_array(entity *ent, ir_node **refs) { pmap_insert(entity_reference_map, (void *)ent, (void *)refs); } -static ir_node **get_type_alloc_array(type *tp) { +static ir_node **get_type_alloc_array(ir_type *tp) { ir_node **res; if (!type_alloc_map) type_alloc_map = pmap_create(); @@ -81,13 +81,13 @@ static ir_node **get_type_alloc_array(type *tp) { return res; } -void set_type_alloc_array(type *tp, ir_node **alls) { +void set_type_alloc_array(ir_type *tp, ir_node **alls) { ir_node **old = pmap_get(type_alloc_map, (void *)tp); if (old != alls) pmap_insert(type_alloc_map, (void *)tp, (void *)alls); } -static ir_node **get_type_cast_array(type *tp) { +static ir_node **get_type_cast_array(ir_type *tp) { ir_node **res; if (!type_cast_map) type_cast_map = pmap_create(); @@ -100,47 +100,47 @@ static ir_node **get_type_cast_array(type *tp) { return res; } -void set_type_cast_array(type *tp, ir_node **alls) { +void set_type_cast_array(ir_type *tp, ir_node **alls) { ir_node **old = pmap_get(type_cast_map, (void *)tp); if (old != alls) pmap_insert(type_cast_map, (void *)tp, (void *)alls); } -static type **get_type_pointertype_array(type *tp) { - type **res; +static ir_type **get_type_pointertype_array(ir_type *tp) { + ir_type **res; if (!type_pointertype_map) type_pointertype_map = pmap_create(); if (pmap_contains(type_pointertype_map, (void *)tp)) { - res = (type **) pmap_get(type_pointertype_map, (void *)tp); + res = (ir_type **) pmap_get(type_pointertype_map, (void *)tp); } else { - res = NEW_ARR_F(type *, 0); + res = NEW_ARR_F(ir_type *, 0); pmap_insert(type_pointertype_map, (void *)tp, (void *)res); } return res; } -void set_type_pointertype_array(type *tp, type **pts) { - type **old = pmap_get(type_pointertype_map, (void *)tp); +void set_type_pointertype_array(ir_type *tp, ir_type **pts) { + ir_type **old = pmap_get(type_pointertype_map, (void *)tp); if (old != pts) pmap_insert(type_pointertype_map, (void *)tp, (void *)pts); } -static type **get_type_arraytype_array(type *tp) { - type **res; +static ir_type **get_type_arraytype_array(ir_type *tp) { + ir_type **res; if (!type_arraytype_map) type_arraytype_map = pmap_create(); if (pmap_contains(type_arraytype_map, (void *)tp)) { - res = (type **) pmap_get(type_arraytype_map, (void *)tp); + res = (ir_type **) pmap_get(type_arraytype_map, (void *)tp); } else { - res = NEW_ARR_F(type *, 0); + res = NEW_ARR_F(ir_type *, 0); pmap_insert(type_arraytype_map, (void *)tp, (void *)res); } return res; } -void set_type_arraytype_array(type *tp, type **pts) { - type **old = pmap_get(type_arraytype_map, (void *)tp); +void set_type_arraytype_array(ir_type *tp, ir_type **pts) { + ir_type **old = pmap_get(type_arraytype_map, (void *)tp); if (old != pts) pmap_insert(type_arraytype_map, (void *)tp, (void *)pts); } @@ -241,7 +241,7 @@ void set_entity_reference(entity *ent, int pos, ir_node *n) { /**------------------------------------------------------------------*/ /* Number of Alloc nodes that create an instance of this type */ -int get_type_n_allocs(type *tp) { +int get_type_n_allocs(ir_type *tp) { ir_node **allocs; assert(tp && is_type(tp)); @@ -251,7 +251,7 @@ int get_type_n_allocs(type *tp) { } /* Alloc node that creates an instance of this type */ -ir_node *get_type_alloc(type *tp, int pos) { +ir_node *get_type_alloc(ir_type *tp, int pos) { ir_node **allocs; assert(0 <= pos && pos < get_type_n_allocs(tp)); @@ -259,7 +259,7 @@ ir_node *get_type_alloc(type *tp, int pos) { return allocs[pos]; } -void add_type_alloc(type *tp, ir_node *n) { +void add_type_alloc(ir_type *tp, ir_node *n) { ir_node **allocs; assert(tp && is_type(tp)); @@ -270,7 +270,7 @@ void add_type_alloc(type *tp, ir_node *n) { set_type_alloc_array(tp, allocs); } -void set_type_alloc(type *tp, int pos, ir_node *n) { +void set_type_alloc(ir_type *tp, int pos, ir_node *n) { ir_node **allocs; assert(0 <= pos && pos < get_type_n_allocs(tp)); @@ -281,7 +281,7 @@ void set_type_alloc(type *tp, int pos, ir_node *n) { } /* Number of Cast nodes that create an instance of this type */ -int get_type_n_casts(type *tp) { +int get_type_n_casts(ir_type *tp) { ir_node **casts; assert(tp && is_type(tp)); @@ -291,7 +291,7 @@ int get_type_n_casts(type *tp) { } -int get_class_n_upcasts(type *clss) { +int get_class_n_upcasts(ir_type *clss) { int i, n_casts = get_type_n_casts(clss); int n_instances = 0; for (i = 0; i < n_casts; ++i) { @@ -301,7 +301,7 @@ int get_class_n_upcasts(type *clss) { return n_instances; } -int get_class_n_downcasts(type *clss) { +int get_class_n_downcasts(ir_type *clss) { int i, n_casts = get_type_n_casts(clss); int n_instances = 0; for (i = 0; i < n_casts; ++i) { @@ -313,7 +313,7 @@ int get_class_n_downcasts(type *clss) { /* Cast node that creates an instance of this type */ -ir_node *get_type_cast(type *tp, int pos) { +ir_node *get_type_cast(ir_type *tp, int pos) { ir_node **casts; assert(0 <= pos && pos < get_type_n_casts(tp)); @@ -321,7 +321,7 @@ ir_node *get_type_cast(type *tp, int pos) { return casts[pos]; } -void add_type_cast(type *tp, ir_node *n) { +void add_type_cast(ir_type *tp, ir_node *n) { ir_node **casts; assert(tp && is_type(tp)); @@ -332,7 +332,7 @@ void add_type_cast(type *tp, ir_node *n) { set_type_cast_array(tp, casts); } -void set_type_cast(type *tp, int pos, ir_node *n) { +void set_type_cast(ir_type *tp, int pos, ir_node *n) { ir_node **casts; assert(0 <= pos && pos < get_type_n_casts(tp)); @@ -344,8 +344,8 @@ void set_type_cast(type *tp, int pos, ir_node *n) { /**------------------------------------------------------------------*/ -int get_type_n_pointertypes_to(type *tp) { - type ** pts; +int get_type_n_pointertypes_to(ir_type *tp) { + ir_type ** pts; assert(tp && is_type(tp)); @@ -353,8 +353,8 @@ int get_type_n_pointertypes_to(type *tp) { return ARR_LEN(pts); } -type *get_type_pointertype_to(type *tp, int pos) { - type ** pts; +ir_type *get_type_pointertype_to(ir_type *tp, int pos) { + ir_type ** pts; assert(0 <= pos && pos < get_type_n_pointertypes_to(tp)); @@ -362,8 +362,8 @@ type *get_type_pointertype_to(type *tp, int pos) { return pts[pos]; } -void add_type_pointertype_to(type *tp, type *ptp) { - type ** pts; +void add_type_pointertype_to(ir_type *tp, ir_type *ptp) { + ir_type ** pts; assert(tp && is_type(tp)); assert(ptp && is_Pointer_type(ptp)); @@ -373,8 +373,8 @@ void add_type_pointertype_to(type *tp, type *ptp) { set_type_pointertype_array(tp, pts); } -void set_type_pointertype_to(type *tp, int pos, type *ptp) { - type ** pts; +void set_type_pointertype_to(ir_type *tp, int pos, ir_type *ptp) { + ir_type ** pts; assert(0 <= pos && pos < get_type_n_pointertypes_to(tp)); assert(ptp && is_Pointer_type(ptp)); @@ -386,8 +386,8 @@ void set_type_pointertype_to(type *tp, int pos, type *ptp) { /**------------------------------------------------------------------*/ -int get_type_n_arraytypes_of(type *tp) { - type ** pts; +int get_type_n_arraytypes_of(ir_type *tp) { + ir_type ** pts; assert(tp && is_type(tp)); @@ -395,8 +395,8 @@ int get_type_n_arraytypes_of(type *tp) { return ARR_LEN(pts); } -type *get_type_arraytype_of(type *tp, int pos) { - type ** pts; +ir_type *get_type_arraytype_of(ir_type *tp, int pos) { + ir_type ** pts; assert(0 <= pos && pos < get_type_n_arraytypes_of(tp)); @@ -404,8 +404,8 @@ type *get_type_arraytype_of(type *tp, int pos) { return pts[pos]; } -void add_type_arraytype_of(type *tp, type *atp) { - type ** pts; +void add_type_arraytype_of(ir_type *tp, ir_type *atp) { + ir_type ** pts; assert(tp && is_type(tp)); assert(atp && is_Array_type(atp)); @@ -415,8 +415,8 @@ void add_type_arraytype_of(type *tp, type *atp) { set_type_arraytype_array(tp, pts); } -void set_type_arraytype_of(type *tp, int pos, type *atp) { - type ** pts; +void set_type_arraytype_of(ir_type *tp, int pos, ir_type *atp) { + ir_type ** pts; assert(0 <= pos && pos < get_type_n_arraytypes_of(tp)); assert(atp && is_Array_type(atp)); @@ -532,7 +532,7 @@ static void chain_accesses(ir_node *n, void *env) { } } -static void chain_types(type *tp) { +static void chain_types(ir_type *tp) { if (is_Pointer_type(tp)) { add_type_pointertype_to(get_pointer_points_to_type(tp), tp); } else if (is_Array_type(tp)) { diff --git a/ir/ana/trouts.h b/ir/ana/trouts.h index f500a0181..8556b2d54 100644 --- a/ir/ana/trouts.h +++ b/ir/ana/trouts.h @@ -61,31 +61,31 @@ ir_node *get_entity_reference(entity *ent, int pos); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /** Number of Alloc nodes that create an instance of this type. */ -int get_type_n_allocs(type *tp); +int get_type_n_allocs(ir_type *tp); /** Alloc node that create an instance of this type. */ -ir_node *get_type_alloc(type *tp, int pos); +ir_node *get_type_alloc(ir_type *tp, int pos); /** Number of Cast nodes that cast a pointer to this type. */ -int get_type_n_casts(type *tp); +int get_type_n_casts(ir_type *tp); /** Cast node that cast a pointer to this type. */ -ir_node *get_type_cast(type *tp, int pos); -void add_type_cast(type *tp, ir_node *cast); +ir_node *get_type_cast(ir_type *tp, int pos); +void add_type_cast(ir_type *tp, ir_node *cast); /** Return number of upcasts. O(#casts). */ -int get_class_n_upcasts(type *clss); +int get_class_n_upcasts(ir_type *clss); /** Return number of downcasts. O(#casts). */ -int get_class_n_downcasts(type *clss); +int get_class_n_downcasts(ir_type *clss); /* Access all pointer types that point to tp. */ -int get_type_n_pointertypes_to(type *tp); -type *get_type_pointertype_to(type *tp, int pos); -void add_type_pointertype_to(type *tp, type *ptp); +int get_type_n_pointertypes_to(ir_type *tp); +ir_type *get_type_pointertype_to(ir_type *tp, int pos); +void add_type_pointertype_to(ir_type *tp, ir_type *ptp); /* Access all array types that contain elements of type tp. * Does not find subarrays, e.g., int[] being element of int[][] * for multi dimensional arrays. */ -int get_type_n_arraytypes_of(type *tp); -type *get_type_arraytype_of(type *tp, int pos); -void add_type_arraytype_of(type *tp, type *atp); +int get_type_n_arraytypes_of(ir_type *tp); +ir_type *get_type_arraytype_of(ir_type *tp, int pos); +void add_type_arraytype_of(ir_type *tp, ir_type *atp); diff --git a/ir/ana2/typalise.c b/ir/ana2/typalise.c index 365396c09..f5a8aa4aa 100644 --- a/ir/ana2/typalise.c +++ b/ir/ana2/typalise.c @@ -65,16 +65,16 @@ static void cough_and_die (ir_node *node) /* Exception b/d */ -static type *java_lang_Throwable_tp = NULL; +static ir_type *java_lang_Throwable_tp = NULL; -static type *get_java_lang_Throwable (void) +static ir_type *get_java_lang_Throwable (void) { assert (NULL != java_lang_Throwable_tp); return (java_lang_Throwable_tp); } -static void find_java_lang_Throwable (type *tp, void *_unused) +static void find_java_lang_Throwable (ir_type *tp, void *_unused) { const char *name = get_type_name (tp); @@ -89,7 +89,7 @@ static void find_java_lang_Throwable (type *tp, void *_unused) /* Ctors, Dtors for typalise_t-s */ -static typalise_t *ta_exact (type *tp) +static typalise_t *ta_exact (ir_type *tp) { typalise_t *ta = xmalloc (sizeof (typalise_t)); ta->kind = type_exact; @@ -111,7 +111,7 @@ static typalise_t *ta_types (lset_t *set) return (ta); } -static typalise_t *ta_type (type *tp) +static typalise_t *ta_type (ir_type *tp) { typalise_t *ta = xmalloc (sizeof (typalise_t)); ta->kind = type_type; @@ -144,7 +144,7 @@ static void ta_delete (typalise_t *ta) Find out whether otype is a subtype of stype. Return non-zero iff otype is a subtype of stype. */ -static int is_subtype (type *otype, type *stype) +static int is_subtype (ir_type *otype, ir_type *stype) { int n_sub = get_class_n_subtypes (stype); int is_sub = FALSE; @@ -155,7 +155,7 @@ static int is_subtype (type *otype, type *stype) } for (i = 0; (!is_sub) && (i < n_sub); i ++) { - type *sub = get_class_subtype (stype, i); + ir_type *sub = get_class_subtype (stype, i); is_sub |= is_subtype (otype, sub); } @@ -169,7 +169,7 @@ static int is_subtype (type *otype, type *stype) Compute the closure of all subtypes of otype (including otype itself) */ -static void _collect_subtypes (type *otype, lset_t *set) +static void _collect_subtypes (ir_type *otype, lset_t *set) { int i, n_sub; @@ -177,13 +177,13 @@ static void _collect_subtypes (type *otype, lset_t *set) n_sub = get_class_n_subtypes (otype); for (i = 0; i < n_sub; i ++) { - type *sub = get_class_subtype (otype, i); + ir_type *sub = get_class_subtype (otype, i); _collect_subtypes (sub, set); } } -static lset_t *subtype_closure (type *otype) +static lset_t *subtype_closure (ir_type *otype) { lset_t *set = lset_create (); @@ -241,9 +241,9 @@ static lset_t *get_owner_types (ir_graph *graph) /** Return a list containing all types of 'set' which are a subtype of 'type'. */ -static lset_t *filter_for_type (lset_t *set, type *stype) +static lset_t *filter_for_type (lset_t *set, ir_type *stype) { - type *curs = (type*) lset_first (set); + ir_type *curs = (ir_type*) lset_first (set); lset_t *lset = lset_create (); while (NULL != curs) { @@ -349,8 +349,8 @@ static typalise_t *ta_join (typalise_t *one, typalise_t *two) res = ta_join (two, one); } break; case (type_type): { - type *one_type = one->res.type; - type *two_type = two->res.type; + ir_type *one_type = one->res.type; + ir_type *two_type = two->res.type; if (is_subtype (one_type, two_type)) { ta_delete (one); @@ -397,7 +397,7 @@ static const char *ta_name (typalise_t *ta) case (type_types): { len += sprintf (buf+len, "one_of "); - type *iter = lset_first (ta->res.types); + ir_type *iter = lset_first (ta->res.types); int size = BUF_SIZE - len - 1; while ((NULL != iter) && (0 < size)) { @@ -423,9 +423,9 @@ static const char *ta_name (typalise_t *ta) method. Presumably, this is because clazz inherits the graph as the implementation for a method. */ -static int uses_graph (type *clazz, entity *meth, ir_graph *graph) +static int uses_graph (ir_type *clazz, entity *meth, ir_graph *graph) { - type *g_clazz = get_entity_owner (meth); + ir_type *g_clazz = get_entity_owner (meth); int i, n_over, use = FALSE; if (g_clazz == clazz) { @@ -472,7 +472,7 @@ static int ta_supports (typalise_t *ta, ir_graph *graph) } case (type_type): { entity *meth = get_irg_entity (graph); - type *tp = get_entity_owner (meth); + ir_type *tp = get_entity_owner (meth); int res = is_subtype (tp, ta->res.type); if (res) { @@ -484,7 +484,7 @@ static int ta_supports (typalise_t *ta, ir_graph *graph) return (res); } case (type_types): { - type *tp = get_entity_owner (get_irg_entity (graph)); + ir_type *tp = get_entity_owner (get_irg_entity (graph)); return (lset_contains (ta->res.types, tp)); } @@ -506,7 +506,7 @@ static int ta_supports (typalise_t *ta, ir_graph *graph) static typalise_t *typalise_call (ir_node *call) { entity *ent = NULL; - type *tp = NULL; + ir_type *tp = NULL; typalise_t *res = NULL; ir_node *call_ptr = get_Call_ptr (call); @@ -561,7 +561,7 @@ static typalise_t *typalise_call (ir_node *call) static typalise_t *typalise_load (ir_node *load) { entity *ent = NULL; - type *tp = NULL; + ir_type *tp = NULL; typalise_t *res = NULL; ir_node *load_ptr = get_Load_ptr (load); @@ -614,7 +614,7 @@ static typalise_t *typalise_proj (ir_node *proj) entity *meth = get_irg_entity (graph); long n = get_Proj_proj (proj); - type *tp = get_method_param_type (get_entity_type (meth), n); + ir_type *tp = get_method_param_type (get_entity_type (meth), n); if (is_Pointer_type (tp)) { tp = get_pointer_points_to_type (tp); } @@ -684,7 +684,7 @@ typalise_t *typalise (ir_node *node) case (iro_Cast): { /* casts always succeed */ typalise_t *ta = NULL; - type *tp = get_Cast_type (node); + ir_type *tp = get_Cast_type (node); if (is_Pointer_type (tp)) { tp = get_pointer_points_to_type (tp); @@ -724,7 +724,7 @@ typalise_t *typalise (ir_node *node) /* FILTER */ /* it's call (sel (ptr)) or load (sel (ptr)) */ entity *ent = get_Sel_entity (node); - type *tp = get_entity_type (ent); + ir_type *tp = get_entity_type (ent); if (is_Method_type (tp)) { /* obsoleted by typalise_call */ @@ -774,7 +774,7 @@ typalise_t *typalise (ir_node *node) } break; case (iro_Alloc): { - type *type = get_Alloc_type (node); + ir_type *type = get_Alloc_type (node); res = ta_exact (type); } break; @@ -793,7 +793,7 @@ typalise_t *typalise (ir_node *node) } if (NULL != meth) { - type *tp = get_method_res_type ((type*) meth, 0); + ir_type *tp = get_method_res_type ((ir_type*) meth, 0); res = ta_type (tp); } else { /* could be anything */ @@ -807,12 +807,12 @@ typalise_t *typalise (ir_node *node) case (iro_SymConst): { if (get_SymConst_kind (node) == symconst_type_tag) { - type *tp = get_SymConst_type (node); + ir_type *tp = get_SymConst_type (node); res = ta_type (tp); } else if (get_SymConst_kind (node) == symconst_addr_ent) { entity *ent = get_SymConst_entity (node); - type *tp = get_entity_owner (ent); + ir_type *tp = get_entity_owner (ent); while (is_Pointer_type (tp)) { tp = get_pointer_points_to_type (tp); @@ -874,6 +874,9 @@ void typalise_init (void) /* $Log$ + Revision 1.12 2006/01/13 21:54:02 beck + renamed all types 'type' to 'ir_type' + Revision 1.11 2005/05/13 16:35:14 beck made (void) prototypes removed unused fprintf arguments diff --git a/ir/ana2/typalise.h b/ir/ana2/typalise.h index 829e95c83..ecb1c296d 100644 --- a/ir/ana2/typalise.h +++ b/ir/ana2/typalise.h @@ -34,7 +34,7 @@ typedef struct typalise { typalise_kind kind; union { - type *type; /* for kind == kind_exact and kind == kind_type */ + ir_type *type; /* for kind == kind_exact and kind == kind_type */ lset_t *types; /* for kind == kind_types */ } res; int id; @@ -66,6 +66,9 @@ void typalise_init (void); /* $Log$ + Revision 1.4 2006/01/13 21:54:03 beck + renamed all types 'type' to 'ir_type' + Revision 1.3 2005/03/22 13:56:09 liekweg "small" fix for exception b/d diff --git a/ir/common/statistics.c b/ir/common/statistics.c index 5a488dc05..276d60559 100644 --- a/ir/common/statistics.c +++ b/ir/common/statistics.c @@ -56,7 +56,7 @@ void print_graph_counts(int verbosity) { void print_type_counts(int verbosity) { int i, counter, total = 0; for (i = 0; i < get_irp_n_types(); i++) { - type *tp = get_irp_type(i); + ir_type *tp = get_irp_type(i); counter = -1; if (is_Class_type(tp)) counter = get_class_n_members(tp); if (is_Struct_type(tp)) counter = get_struct_n_members(tp); -- 2.20.1