Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
9ab9464c
Commit
9ab9464c
authored
Jan 13, 2006
by
Michael Beck
Browse files
renamed all types 'type' to 'ir_type'
[r7230]
parent
5d8d9dd2
Changes
12
Hide whitespace changes
Inline
Side-by-side
ir/ana/cgana.c
View file @
9ab9464c
...
...
@@ -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
);
...
...
ir/ana/field_temperature.c
View file @
9ab9464c
...
...
@@ -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
);
}
...
...
ir/ana/irconsconfirm.c
View file @
9ab9464c
...
...
@@ -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
);
}
...
...
ir/ana/irsimpletype.c
View file @
9ab9464c
...
...
@@ -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
);
...
...
ir/ana/irtypeinfo.c
View file @
9ab9464c
...
...
@@ -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
);
...
...
ir/ana/rta.c
View file @
9ab9464c
...
...
@@ -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
*
...
...
ir/ana/rta.h
View file @
9ab9464c
...
...
@@ -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
*
...
...
ir/ana/trouts.c
View file @
9ab9464c
...
...
@@ -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
))
{
...
...
ir/ana/trouts.h
View file @
9ab9464c
...
...
@@ -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
);