/* ====================
Alloc stuff
==================== */
-static void append_alloc (graph_info_t *ginfo, ir_node *alloc, type *tp)
+static void append_alloc (graph_info_t *ginfo, ir_node *alloc, ir_type *tp)
{
alloc_info_t *ainfo = xmalloc (sizeof (alloc_info_t));
assert (0 && "Unexpected address expression");
}
} else if (op_Alloc == op) {
- type *tp = get_Alloc_type (node);
+ ir_type *tp = get_Alloc_type (node);
/* const char *name = get_type_name (tp); */
append_alloc (graph_info, node, tp);
/*
$Log$
+ Revision 1.22 2006/01/13 22:55:03 beck
+ renamed all types 'type' to 'ir_type'
+
Revision 1.21 2005/12/31 15:58:57 beck
added missing includes
/* See whether the given entity is a field. */
static int is_field (entity *ent)
{
- type *tp = get_entity_type (ent);
+ ir_type *tp = get_entity_type (ent);
if (is_Primitive_type (tp) || is_Pointer_type (tp)) {
/* actually, we don't get by by restricting ourselves to pointer types */
}
}
-/* Helper to collect_fields(type*): collect all fields of the given
+/* Helper to collect_fields(ir_type*): collect all fields of the given
clazz and its super classes into the given obstack. */
-static void _collect_fields (type *clazz, struct obstack *obst)
+static void _collect_fields (ir_type *clazz, struct obstack *obst)
{
int n_members = get_class_n_members (clazz);
int n_supers = get_class_n_supertypes (clazz);
}
for (i = 0; i < n_supers; i ++) {
- type *s_clazz = get_class_supertype (clazz, i);
+ ir_type *s_clazz = get_class_supertype (clazz, i);
_collect_fields (s_clazz, obst);
}
/* Collect the fields of the given class and its super classes into an array.
The last entry of the array is written NULL. */
-static entity **collect_fields (type *clazz)
+static entity **collect_fields (ir_type *clazz)
{
struct obstack obst;
int n_fields;
/* Write a node for the given descriptor into the given stream */
static void pto_name_dump_desc (desc_t *desc, FILE *stream)
{
- type *tp = desc->tp;
+ ir_type *tp = desc->tp;
const char *tp_name = get_type_name (tp);
ir_node *nd;
/* get a new descriptor for the given type at the given node */
-desc_t *new_name (type *tp, ir_node *node, int ctx)
+desc_t *new_name (ir_type *tp, ir_node *node, int ctx)
{
desc_t *desc = NULL;
{
int i;
int missing = TRUE;
- type *tp = get_entity_type (ent);
+ ir_type *tp = get_entity_type (ent);
assert (is_Pointer_type (tp));
tp = get_pointer_points_to_type (tp);
\f
/*
$Log$
+ Revision 1.18 2006/01/13 22:56:21 beck
+ renamed all types 'type' to 'ir_type'
+
Revision 1.17 2005/12/16 16:59:54 grund
*** empty log message ***
}
static ir_node *
-new_bd_Const_type (dbg_info *db, ir_node *block, ir_mode *mode, tarval *con, type *tp)
+new_bd_Const_type (dbg_info *db, ir_node *block, ir_mode *mode, tarval *con, ir_type *tp)
{
ir_node *res;
ir_graph *irg = current_ir_graph;
}
static ir_node *
-new_bd_Cast (dbg_info *db, ir_node *block, ir_node *op, type *to_tp)
+new_bd_Cast (dbg_info *db, ir_node *block, ir_node *op, ir_type *to_tp)
{
ir_node *res;
ir_graph *irg = current_ir_graph;
static ir_node *
new_bd_Call (dbg_info *db, ir_node *block, ir_node *store,
- ir_node *callee, int arity, ir_node **in, type *tp)
+ ir_node *callee, int arity, ir_node **in, ir_type *tp)
{
ir_node **r_in;
ir_node *res;
static ir_node *
new_bd_Alloc (dbg_info *db, ir_node *block, ir_node *store,
- ir_node *size, type *alloc_type, where_alloc where)
+ ir_node *size, ir_type *alloc_type, where_alloc where)
{
ir_node *in[2];
ir_node *res;
static ir_node *
new_bd_Free (dbg_info *db, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, type *free_type, where_alloc where)
+ ir_node *ptr, ir_node *size, ir_type *free_type, where_alloc where)
{
ir_node *in[3];
ir_node *res;
static ir_node *
new_bd_InstOf (dbg_info *db, ir_node *block, ir_node *store,
- ir_node *objptr, type *ent)
+ ir_node *objptr, ir_type *ent)
{
ir_node **r_in;
ir_node *res;
static ir_node *
new_bd_SymConst_type (dbg_info *db, ir_node *block, symconst_symbol value,
- symconst_kind symkind, type *tp) {
+ symconst_kind symkind, ir_type *tp) {
ir_node *res;
ir_mode *mode;
ir_graph *irg = current_ir_graph;
static ir_node *
new_bd_CopyB (dbg_info *db, ir_node *block,
- ir_node *store, ir_node *dst, ir_node *src, type *data_type)
+ ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type)
{
ir_node *in[3];
ir_node *res;
}
ir_node *
-new_rd_Const_type (dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con, type *tp)
+new_rd_Const_type (dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con, ir_type *tp)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
}
ir_node *
-new_rd_Cast (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, type *to_tp)
+new_rd_Cast (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_type *to_tp)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
ir_node *
new_rd_Call (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *callee, int arity, ir_node **in, type *tp)
+ ir_node *callee, int arity, ir_node **in, ir_type *tp)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
ir_node *
new_rd_Alloc (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *size, type *alloc_type, where_alloc where)
+ ir_node *size, ir_type *alloc_type, where_alloc where)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
ir_node *
new_rd_Free (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, type *free_type, where_alloc where)
+ ir_node *ptr, ir_node *size, ir_type *free_type, where_alloc where)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
ir_node *
new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *objptr, type *ent)
+ ir_node *objptr, ir_type *ent)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
ir_node *
new_rd_SymConst_type (dbg_info *db, ir_graph *irg, ir_node *block, symconst_symbol value,
- symconst_kind symkind, type *tp)
+ symconst_kind symkind, ir_type *tp)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
return res;
}
-ir_node *new_rd_SymConst_addr_ent (dbg_info *db, ir_graph *irg, entity *symbol, type *tp)
+ir_node *new_rd_SymConst_addr_ent (dbg_info *db, ir_graph *irg, entity *symbol, ir_type *tp)
{
- symconst_symbol sym = {(type *)symbol};
+ symconst_symbol sym = {(ir_type *)symbol};
return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_addr_ent, tp);
}
-ir_node *new_rd_SymConst_addr_name (dbg_info *db, ir_graph *irg, ident *symbol, type *tp) {
- symconst_symbol sym = {(type *)symbol};
+ir_node *new_rd_SymConst_addr_name (dbg_info *db, ir_graph *irg, ident *symbol, ir_type *tp) {
+ symconst_symbol sym = {(ir_type *)symbol};
return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_addr_name, tp);
}
-ir_node *new_rd_SymConst_type_tag (dbg_info *db, ir_graph *irg, type *symbol, type *tp) {
+ir_node *new_rd_SymConst_type_tag (dbg_info *db, ir_graph *irg, ir_type *symbol, ir_type *tp) {
symconst_symbol sym = {symbol};
return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_type_tag, tp);
}
-ir_node *new_rd_SymConst_size (dbg_info *db, ir_graph *irg, type *symbol, type *tp) {
+ir_node *new_rd_SymConst_size (dbg_info *db, ir_graph *irg, ir_type *symbol, ir_type *tp) {
symconst_symbol sym = {symbol};
return new_rd_SymConst_type(db, irg, irg->start_block, sym, symconst_size, tp);
}
}
ir_node *new_rd_CopyB(dbg_info *db, ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *dst, ir_node *src, type *data_type)
+ ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type)
{
ir_node *res;
ir_graph *rem = current_ir_graph;
}
ir_node *new_r_Const_type(ir_graph *irg, ir_node *block,
- ir_mode *mode, tarval *con, type *tp) {
+ ir_mode *mode, tarval *con, ir_type *tp) {
return new_rd_Const_type(NULL, irg, block, mode, con, tp);
}
return new_rd_Sel(NULL, irg, block, store, objptr, n_index, index, ent);
}
ir_node *new_r_InstOf (ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr,
- type *ent) {
+ ir_type *ent) {
return (new_rd_InstOf (NULL, irg, block, store, objptr, ent));
}
ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store,
ir_node *callee, int arity, ir_node **in,
- type *tp) {
+ ir_type *tp) {
return new_rd_Call(NULL, irg, block, store, callee, arity, in, tp);
}
ir_node *new_r_Add (ir_graph *irg, ir_node *block,
ir_node *op, ir_mode *mode) {
return new_rd_Conv(NULL, irg, block, op, mode);
}
-ir_node *new_r_Cast (ir_graph *irg, ir_node *block, ir_node *op, type *to_tp) {
+ir_node *new_r_Cast (ir_graph *irg, ir_node *block, ir_node *op, ir_type *to_tp) {
return new_rd_Cast(NULL, irg, block, op, to_tp);
}
ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity,
return new_rd_Store(NULL, irg, block, store, adr, val);
}
ir_node *new_r_Alloc (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *size, type *alloc_type, where_alloc where) {
+ ir_node *size, ir_type *alloc_type, where_alloc where) {
return new_rd_Alloc(NULL, irg, block, store, size, alloc_type, where);
}
ir_node *new_r_Free (ir_graph *irg, ir_node *block, ir_node *store,
- ir_node *ptr, ir_node *size, type *free_type, where_alloc where) {
+ ir_node *ptr, ir_node *size, ir_type *free_type, where_alloc where) {
return new_rd_Free(NULL, irg, block, store, ptr, size, free_type, where);
}
ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node **in) {
return new_rd_Mux(NULL, irg, block, sel, ir_false, ir_true, mode);
}
ir_node *new_r_CopyB(ir_graph *irg, ir_node *block,
- ir_node *store, ir_node *dst, ir_node *src, type *data_type) {
+ ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type) {
return new_rd_CopyB(NULL, irg, block, store, dst, src, data_type);
}
ir_node *new_r_Bound(ir_graph *irg, ir_node *block,
}
ir_node *
-new_d_Const_type (dbg_info *db, ir_mode *mode, tarval *con, type *tp)
+new_d_Const_type (dbg_info *db, ir_mode *mode, tarval *con, ir_type *tp)
{
return new_bd_Const_type(db, current_ir_graph->start_block,
mode, con, tp);
}
ir_node *
-new_d_Cast (dbg_info *db, ir_node *op, type *to_tp)
+new_d_Cast (dbg_info *db, ir_node *op, ir_type *to_tp)
{
return new_bd_Cast(db, current_ir_graph->current_block, op, to_tp);
}
ir_node *
new_d_Call (dbg_info *db, ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *tp)
+ ir_type *tp)
{
ir_node *res;
res = new_bd_Call (db, current_ir_graph->current_block,
}
ir_node *
-new_d_Alloc (dbg_info *db, ir_node *store, ir_node *size, type *alloc_type,
+new_d_Alloc (dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type,
where_alloc where)
{
ir_node *res;
ir_node *
new_d_Free (dbg_info *db, ir_node *store, ir_node *ptr,
- ir_node *size, type *free_type, where_alloc where)
+ ir_node *size, ir_type *free_type, where_alloc where)
{
return new_bd_Free (db, current_ir_graph->current_block,
store, ptr, size, free_type, where);
}
ir_node *
-new_d_InstOf (dbg_info *db, ir_node *store, ir_node *objptr, type *ent)
+new_d_InstOf (dbg_info *db, ir_node *store, ir_node *objptr, ir_type *ent)
{
return (new_bd_InstOf (db, current_ir_graph->current_block,
store, objptr, ent));
}
ir_node *
-new_d_SymConst_type (dbg_info *db, symconst_symbol value, symconst_kind kind, type *tp)
+new_d_SymConst_type (dbg_info *db, symconst_symbol value, symconst_kind kind, ir_type *tp)
{
return new_bd_SymConst_type (db, current_ir_graph->start_block,
value, kind, tp);
}
ir_node *new_d_CopyB(dbg_info *db,ir_node *store,
- ir_node *dst, ir_node *src, type *data_type) {
+ ir_node *dst, ir_node *src, ir_type *data_type) {
ir_node *res;
res = new_bd_CopyB(db, current_ir_graph->current_block,
store, dst, src, data_type);
}
/* Returns the frame type of the current graph */
-type *get_cur_frame_type(void) {
+ir_type *get_cur_frame_type(void) {
return get_irg_frame_type(current_ir_graph);
}
return new_d_Const_long(NULL, mode, value);
}
-ir_node *new_Const_type(tarval *con, type *tp) {
+ir_node *new_Const_type(tarval *con, ir_type *tp) {
return new_d_Const_type(NULL, get_type_mode(tp), con, tp);
}
entity *ent) {
return new_d_Sel(NULL, store, objptr, arity, in, ent);
}
-ir_node *new_InstOf (ir_node *store, ir_node *objptr, type *ent) {
+ir_node *new_InstOf (ir_node *store, ir_node *objptr, ir_type *ent) {
return new_d_InstOf (NULL, store, objptr, ent);
}
ir_node *new_Call (ir_node *store, ir_node *callee, int arity, ir_node **in,
- type *tp) {
+ ir_type *tp) {
return new_d_Call(NULL, store, callee, arity, in, tp);
}
ir_node *new_Add (ir_node *op1, ir_node *op2, ir_mode *mode) {
ir_node *new_Conv (ir_node *op, ir_mode *mode) {
return new_d_Conv(NULL, op, mode);
}
-ir_node *new_Cast (ir_node *op, type *to_tp) {
+ir_node *new_Cast (ir_node *op, ir_type *to_tp) {
return new_d_Cast(NULL, op, to_tp);
}
ir_node *new_Phi (int arity, ir_node **in, ir_mode *mode) {
ir_node *new_Store (ir_node *store, ir_node *addr, ir_node *val) {
return new_d_Store(NULL, store, addr, val);
}
-ir_node *new_Alloc (ir_node *store, ir_node *size, type *alloc_type,
+ir_node *new_Alloc (ir_node *store, ir_node *size, ir_type *alloc_type,
where_alloc where) {
return new_d_Alloc(NULL, store, size, alloc_type, where);
}
ir_node *new_Free (ir_node *store, ir_node *ptr, ir_node *size,
- type *free_type, where_alloc where) {
+ ir_type *free_type, where_alloc where) {
return new_d_Free(NULL, store, ptr, size, free_type, where);
}
ir_node *new_Sync (int arity, ir_node **in) {
ir_node *new_Mux (ir_node *sel, ir_node *ir_false, ir_node *ir_true, ir_mode *mode) {
return new_d_Mux(NULL, sel, ir_false, ir_true, mode);
}
-ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, type *data_type) {
+ir_node *new_CopyB(ir_node *store, ir_node *dst, ir_node *src, ir_type *data_type) {
return new_d_CopyB(NULL, store, dst, src, data_type);
}
ir_node *new_Bound(ir_node *store, ir_node *idx, ir_node *lower, ir_node *upper) {
* returns the name of a type or <ERROR> if mode is NOT a mode object.
* in the later case, sets bad
*/
-const char *get_type_name_ex(type *tp, int *bad)
+const char *get_type_name_ex(ir_type *tp, int *bad)
{
if (is_type(tp))
return get_type_name(tp);
* prints the edge from a type S to a type T with additional info fmt, ...
* to the file F
*/
-static void print_type_type_edge(FILE *F, type *S, type *T, const char *fmt, ...)
+static void print_type_type_edge(FILE *F, ir_type *S, ir_type *T, const char *fmt, ...)
{
va_list ap;
* prints the edge from a type T to an entity E with additional info fmt, ...
* to the file F
*/
-static void print_type_ent_edge(FILE *F, type *T, entity *E, const char *fmt, ...)
+static void print_type_ent_edge(FILE *F, ir_type *T, entity *E, const char *fmt, ...)
{
va_list ap;
* prints the edge from an entity E to a type T with additional info fmt, ...
* to the file F
*/
-static void print_ent_type_edge(FILE *F, entity *E, type *T, const char *fmt, ...)
+static void print_ent_type_edge(FILE *F, entity *E, ir_type *T, const char *fmt, ...)
{
va_list ap;
* prints the edge from a node N to a type T with additional info fmt, ...
* to the file F
*/
-static void print_node_type_edge(FILE *F, const ir_node *N, type *T, const char *fmt, ...)
+static void print_node_type_edge(FILE *F, const ir_node *N, ir_type *T, const char *fmt, ...)
{
va_list ap;
* prints the edge from a type E to an enumeration item item with additional info fmt, ...
* to the file F
*/
-static void print_enum_item_edge(FILE *F, type *E, int item, const char *fmt, ...)
+static void print_enum_item_edge(FILE *F, ir_type *E, int item, const char *fmt, ...)
{
va_list ap;
if (opt_dump_analysed_type_info) {
if (get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_inconsistent) {
- type *tp = get_irn_typeinfo_type(n);
+ ir_type *tp = get_irn_typeinfo_type(n);
if (tp != firm_none_type)
fprintf(F, "[%s] ", get_type_name_ex(tp, &bad));
else
}
#if 0
-static int print_type_info(FILE *F, type *tp) {
+static int print_type_info(FILE *F, ir_type *tp) {
int bad = 0;
if (get_type_state(tp) == layout_undefined) {
return bad;
}
-static void print_typespecific_info(FILE *F, type *tp) {
+static void print_typespecific_info(FILE *F, ir_type *tp) {
switch (get_type_tpop_code(tp)) {
case tpo_class:
{
}
#endif
-static void print_typespecific_vcgattr(FILE *F, type *tp) {
+static void print_typespecific_vcgattr(FILE *F, ir_type *tp) {
switch (get_type_tpop_code(tp)) {
case tpo_class:
{
}
-int dump_type_node(FILE *F, type *tp)
+int dump_type_node(FILE *F, ir_type *tp)
{
int bad = 0;
}
#undef X
-static void dump_enum_item(FILE *F, type *tp, int pos)
+static void dump_enum_item(FILE *F, ir_type *tp, int pos)
{
char buf[1024];
ident *id = get_enumeration_nameid(tp, pos);
} break;
case k_type:
{
- type *tp = (type *)tore;
+ ir_type *tp = (ir_type *)tore;
dump_type_node(F, tp);
/* and now the edges */
switch (get_type_tpop_code(tp)) {
} break; /* case k_entity */
case k_type:
{
- type *tp = (type *)tore;
+ ir_type *tp = (ir_type *)tore;
if (tp == get_glob_type()) break;
switch (get_type_tpop_code(tp)) {
case tpo_class: {
/** Write the type and all its attributes to the file passed.
* */
-void dump_type_to_file (FILE *f, type *tp, dump_verbosity verbosity);
+void dump_type_to_file (FILE *f, ir_type *tp, dump_verbosity verbosity);
/** Write the type and all its attributes to stdout.
* */
-void dump_type (type *tp);
+void dump_type (ir_type *tp);
/** Dump type information as text.
const char *get_ent_dump_name(entity *ent);
-const char *get_type_name_ex(type *tp, int *bad);
+const char *get_type_name_ex(ir_type *tp, int *bad);
const char *get_mode_name_ex(ir_mode *mode, int *bad);
/**
* dump the name of a node n to the File F.
/** Writes vcg representation with title "PRINT_TYPEID(tp)" to file F. */
-int dump_type_node(FILE *F, type *tp);
+int dump_type_node(FILE *F, ir_type *tp);
#endif /* __IRDUMPT_T_H__ */
/* not dumped: mature */
} break;
case iro_Start: {
- type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
+ ir_type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
fprintf(F, " start of method of type %s \n", get_type_name_ex(tp, &bad));
for (i = 0; i < get_method_n_params(tp); ++i)
fprintf(F, " param %d type: %s \n", i, get_type_name_ex(get_method_param_type(tp, i), &bad));
}
} break;
case iro_Call: {
- type *tp = get_Call_type(n);
+ ir_type *tp = get_Call_type(n);
fprintf(F, " calling method of type %s \n", get_type_name_ex(tp, &bad));
if(get_unknown_type() != tp) {
for (i = 0; i < get_method_n_params(tp); ++i)
} break;
case iro_Return: {
if (!get_interprocedural_view()) {
- type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
+ ir_type *tp = get_entity_type(get_irg_entity(get_irn_irg(n)));
fprintf(F, " return in method of type %s \n", get_type_name_ex(tp, &bad));
for (i = 0; i < get_method_n_ress(tp); ++i)
fprintf(F, " res %d type: %s \n", i, get_type_name_ex(get_method_res_type(tp, i), &bad));
}
} break;
case iro_Const: {
- type *tp = get_Const_type(n);
+ ir_type *tp = get_Const_type(n);
assert(tp != firm_none_type);
fprintf(F, " Const of type %s \n", get_type_name_ex(get_Const_type(n), &bad));
} break;
* "prefix" node8, ... node15,\n
* "prefix" node16, node17\n
*/
-static void dump_type_list(FILE *F, type *tp, char *prefix,
- int (*get_n_types)(type *tp),
- type *(*get_type)(type *tp, int pos),
+static void dump_type_list(FILE *F, ir_type *tp, char *prefix,
+ int (*get_n_types)(ir_type *tp),
+ ir_type *(*get_type)(ir_type *tp, int pos),
char *name) {
int i, n_nodes = get_n_types(tp);
char *comma = "";
#define X(a) case a: fprintf(F, #a); break
void dump_entity_to_file_prefix (FILE *F, entity *ent, char *prefix, unsigned verbosity) {
int i, j;
- type *owner, *type;
+ ir_type *owner, *type;
assert(is_entity(ent));
owner = get_entity_owner(ent);
}
/* A fast hack to dump a csv. */
-void dump_typecsv_to_file(FILE *F, type *tp, dump_verbosity verbosity, const char *comma) {
+void dump_typecsv_to_file(FILE *F, ir_type *tp, dump_verbosity verbosity, const char *comma) {
int i;
char buf[1024 + 10];
if (!is_Class_type(tp)) return; // we also want array types. Stupid, these are classes in java.
}
}
-void dump_type_to_file (FILE *F, type *tp, dump_verbosity verbosity) {
+void dump_type_to_file (FILE *F, ir_type *tp, dump_verbosity verbosity) {
int i;
if ((is_Class_type(tp)) && (verbosity & dump_verbosity_noClassTypes)) return;
if (verbosity & dump_verbosity_typeattrs) {
fprintf(F, " supertypes: ");
for (i = 0; i < get_class_n_supertypes(tp); ++i) {
- type *stp = get_class_supertype(tp, i);
+ ir_type *stp = get_class_supertype(tp, i);
fprintf(F, "\n %s", get_type_name(stp));
}
fprintf(F, "\n subtypes: ");
for (i = 0; i < get_class_n_subtypes(tp); ++i) {
- type *stp = get_class_subtype(tp, i);
+ ir_type *stp = get_class_subtype(tp, i);
fprintf(F, "\n %s", get_type_name(stp));
}
if (get_irp_inh_transitive_closure_state() != inh_transitive_closure_none) {
- type *stp;
+ ir_type *stp;
fprintf(F, "\n transitive supertypes: ");
for (stp = get_class_trans_supertype_first(tp);
stp;
case tpo_array:
if (verbosity & dump_verbosity_typeattrs) {
int i, n_dim;
- type *elem_tp = get_array_element_type(tp);
+ ir_type *elem_tp = get_array_element_type(tp);
fprintf(F, "\n array ");
case tpo_pointer:
if (verbosity & dump_verbosity_typeattrs) {
- type *tt = get_pointer_points_to_type(tp);
+ ir_type *tt = get_pointer_points_to_type(tp);
fprintf(F, "\n points to %s (%ld)\n", get_type_name(tt), get_type_nr(tt));
}
break;
fprintf(F, "\n variadicity: %s", get_variadicity_name(get_method_variadicity(tp)));
fprintf(F, "\n return types: %d", get_method_n_ress(tp));
for (i = 0; i < get_method_n_ress(tp); ++i) {
- type *rtp = get_method_res_type(tp, i);
+ ir_type *rtp = get_method_res_type(tp, i);
fprintf(F, "\n %s", get_type_name(rtp));
}
fprintf(F, "\n parameter types: %d", get_method_n_params(tp));
for (i = 0; i < get_method_n_params(tp); ++i) {
- type *ptp = get_method_param_type(tp, i);
+ ir_type *ptp = get_method_param_type(tp, i);
fprintf(F, "\n %s", get_type_name(ptp));
}
if (get_method_variadicity(tp)) {
fprintf(F, "\n\n");
}
-void dump_type(type *tp) {
+void dump_type(ir_type *tp) {
dump_type_to_file (stdout, tp, dump_verbosity_max);
}
}
for (i = 0; i < n_types; ++i) {
- type *t = get_irp_type(i);
+ ir_type *t = get_irp_type(i);
//if (is_jack_rts_class(t)) continue;
void dump_globals_as_text(unsigned verbosity, const char *suffix) {
const char *basename;
FILE *F, *CSV = NULL;
- type *g = get_glob_type();
+ ir_type *g = get_glob_type();
int i, n_mems = get_class_n_members(g);
basename = irp_prog_name_is_set() ? get_irp_prog_name() : "TextGlobals";
static INLINE void
copy_node_inline (ir_node *n, void *env) {
ir_node *new;
- type *frame_tp = (type *)env;
+ ir_type *frame_tp = (ir_type *)env;
copy_node(n, NULL);
if (get_irn_op(n) == op_Sel) {
*/
static int can_inline(ir_node *call, ir_graph *called_graph)
{
- type *call_type = get_Call_type(call);
+ ir_type *call_type = get_Call_type(call);
int params, ress, i, res;
assert(is_Method_type(call_type));
/* check params */
for (i = 0; i < params; ++i) {
- type *p_type = get_method_param_type(call_type, i);
+ ir_type *p_type = get_method_param_type(call_type, i);
if (is_compound_type(p_type))
return 0;
/* check res */
for (i = 0; i < ress; ++i) {
- type *r_type = get_method_res_type(call_type, i);
+ ir_type *r_type = get_method_res_type(call_type, i);
if (is_compound_type(r_type))
return 0;
ir_node *ret, *phi;
int arity, n_ret, n_exc, n_res, i, j, rem_opt, irn_arity;
int exc_handling;
- type *called_frame;
+ ir_type *called_frame;
irg_inline_property prop = get_irg_inline_property(called_graph);
if ( (prop != irg_inline_forced) &&
entity *get_irg_entity (const ir_graph *irg);
void set_irg_entity (ir_graph *irg, entity *ent);
-type *get_irg_frame_type (ir_graph *irg);
-void set_irg_frame_type (ir_graph *irg, type *ftp);
+ir_type *get_irg_frame_type (ir_graph *irg);
+void set_irg_frame_type (ir_graph *irg, ir_type *ftp);
ir_node *get_irg_start_block (const ir_graph *irg);
void set_irg_start_block (ir_graph *irg, ir_node *node);
/* Walk constant array bounds. */
for (i = 0; i < get_irp_n_types(); i++) {
- type *tp = get_irp_type(i);
+ ir_type *tp = get_irp_type(i);
if (is_Array_type(tp)) {
for (j = 0; j < get_array_n_dimensions(tp); j++) {
ir_node *n = get_array_lower_bound(tp, j);
void (*_hook_new_entity)(void *context, entity *ent);
/** This hook is called after a new type was created. */
- void (*_hook_new_type)(void *context, type *tp);
+ void (*_hook_new_type)(void *context, ir_type *tp);
} hook;
/** the context for every hook */
res->kind = k_ir_prog;
res->graphs = NEW_ARR_F(ir_graph *, 0);
res->pseudo_graphs = NEW_ARR_F(ir_graph *, 0);
- res->types = NEW_ARR_F(type *, 0);
+ res->types = NEW_ARR_F(ir_type *, 0);
res->modes = NEW_ARR_F(ir_mode *, 0);
#ifdef DEBUG_libfirm
irp->main_irg = main_irg;
}
-type *(get_glob_type)(void) {
+ir_type *(get_glob_type)(void) {
return _get_glob_type();
}
}
/* Adds type to the list of types in irp. */
-void add_irp_type(type *typ) {
+void add_irp_type(ir_type *typ) {
assert (typ != NULL);
assert(irp);
- ARR_APP1 (type *, irp->types, typ);
+ ARR_APP1 (ir_type *, irp->types, typ);
}
/* Remove type form the list of types in irp. */
-void remove_irp_type(type *typ) {
+void remove_irp_type(ir_type *typ) {
int i;
assert(typ);
for(; i < (ARR_LEN(irp->types)) - 1; i++) {
irp->types[i] = irp->types[i+1];
}
- ARR_SETLEN(type *, irp->types, (ARR_LEN(irp->types)) - 1);
+ ARR_SETLEN(ir_type *, irp->types, (ARR_LEN(irp->types)) - 1);
break;
}
}
return _get_irp_n_types();
}
-type *(get_irp_type) (int pos) {
+ir_type *(get_irp_type) (int pos) {
return _get_irp_type(pos);
}
-void set_irp_type(int pos, type *typ) {
+void set_irp_type(int pos, ir_type *typ) {
assert (irp && typ);
assert (pos < (ARR_LEN((irp)->types)));
irp->types[pos] = typ;
/** Returns the "global" type of the irp. */
-type *get_glob_type(void);
+ir_type *get_glob_type(void);
/** Adds type to the list of types in irp. */
-void add_irp_type(type *typ);
+void add_irp_type(ir_type *typ);
/** Removes type from the list of types, deallocates it and
shrinks the list by one. */
-void remove_irp_type(type *typ);
+void remove_irp_type(ir_type *typ);
/** Returns the number of all types in the irp. */
int get_irp_n_types(void);
/** Returns the type at position pos in the irp. */
-type *get_irp_type(int pos);
+ir_type *get_irp_type(int pos);
/** Overwrites the type at position pos with another type. */
-void set_irp_type(int pos, type *typ);
+void set_irp_type(int pos, ir_type *typ);
/** Returns the number of all modes in the irp. */
int get_irp_n_modes(void);
entity *ent = get_irg_entity(irg);
if (ent) {
- type *ent_type = get_entity_owner(ent);
+ ir_type *ent_type = get_entity_owner(ent);
if (ent_type) {
if (ent_type == get_glob_type())
/**
* Prints a failure message for a proj from Start
*/
-static void show_proj_mode_failure(ir_node *n, type *ty)
+static void show_proj_mode_failure(ir_node *n, ir_type *ty)
{
long proj = get_Proj_proj(n);
ir_mode *m = get_type_mode(ty);
/**
* Show call parameters
*/
-static void show_call_param(ir_node *n, type *mt)
+static void show_call_param(ir_node *n, ir_type *mt)
{
int i;
/**
* Show return modes
*/
-static void show_return_modes(ir_graph *irg, ir_node *n, type *mt, int i)
+static void show_return_modes(ir_graph *irg, ir_node *n, ir_type *mt, int i)
{
entity *ent = get_irg_entity(irg);
/**
* Show return number of results
*/
-static void show_return_nres(ir_graph *irg, ir_node *n, type *mt)
+static void show_return_nres(ir_graph *irg, ir_node *n, ir_type *mt)
{
entity *ent = get_irg_entity(irg);
ir_mode *mode = get_irn_mode(p);
long proj = get_Proj_proj(p);
long nr = get_Proj_proj(pred);
- type *mt; /* A method type */
+ ir_type *mt; /* A method type */
pred = skip_Id(get_Proj_pred(pred));
ASSERT_AND_RET((get_irn_mode(pred) == mode_T), "Proj from something not a tuple", 0);
int i;
ir_mode *mymode = get_irn_mode(n);
ir_mode *mem_mode = get_irn_mode(get_Return_mem(n));
- type *mt;
+ ir_type *mt;
/* Return: BB x M x data1 x ... x datan --> X */
"Number of results for Return doesn't match number of results in type.", 0,
show_return_nres(irg, n, mt););
for (i = get_Return_n_ress(n) - 1; i >= 0; --i) {
- type *res_type = get_method_res_type(mt, i);
+ ir_type *res_type = get_method_res_type(mt, i);
if (is_atomic_type(res_type)) {
ASSERT_AND_RET_DBG(
ir_mode *mymode = get_irn_mode(n);
ir_mode *op1mode = get_irn_mode(get_Call_mem(n));
ir_mode *op2mode = get_irn_mode(get_Call_ptr(n));
- type *mt;
+ ir_type *mt;
int i;
/* Call: BB x M x ref x data1 x ... x datan
}
for (i = 0; i < get_method_n_params(mt); i++) {
- type *t = get_method_param_type(mt, i);
+ ir_type *t = get_method_param_type(mt, i);
if (is_atomic_type(t)) {
ASSERT_AND_RET_DBG(
ir_mode *op1mode = get_irn_mode(get_CopyB_mem(n));
ir_mode *op2mode = get_irn_mode(get_CopyB_dst(n));
ir_mode *op3mode = get_irn_mode(get_CopyB_src(n));
- type *t = get_CopyB_type(n);
+ ir_type *t = get_CopyB_type(n);
/* CopyB: BB x M x ref x ref --> M x X */
ASSERT_AND_RET(
* If we find a dynamic type this means that the pointer always points
* to an object of this type during runtime. We resolved polymorphy.
*/
-static type *get_dynamic_type(ir_node *ptr) {
+static ir_type *get_dynamic_type(ir_node *ptr) {
ptr = skip_Cast(skip_Proj(ptr));
if (get_irn_op(ptr) == op_Alloc)
return get_Alloc_type(ptr);
ir_node *transform_node_Sel(ir_node *node)
{
ir_node *new_node, *ptr;
- type *dyn_tp;
+ ir_type *dyn_tp;
entity *ent = get_Sel_entity(node);
if (get_irp_phase_state() == phase_building) return node;
{
ir_node *field_ptr, *new_node, *ptr;
entity *ent;
- type *dyn_tp;
+ ir_type *dyn_tp;
if (!(get_opt_optimize() && get_opt_dyn_meth_dispatch()))
return n;
*/
static void process_call(ir_node *call, entity *callee, q_set *hmap)
{
- type *mtp;
+ ir_type *mtp;
entry_t *key, *entry;
ir_node *call_param;
int i, n_params;
**/
static void change_entity_type(quad_t *q, entity *ent, unsigned *nr)
{
- type *mtp, *new_mtp, *tp;
- ident *tp_name;
+ ir_type *mtp, *new_mtp, *tp;
+ ident *tp_name;
int i, n_params, n_ress, pos = 0;
mtp = get_entity_type(q->ent);
static ir_node *new_cl_Call(ir_node *call, entity *new_entity, int pos)
{
ir_node **in;
- type *mtp;
+ ir_type *mtp;
int i, n_params, new_params = 0;
ir_node *callee;
symconst_symbol sym;
typedef struct _scalars_t {
entity *ent; /**< A entity for scalar replacement. */
- type *ent_owner; /**< The owner of this entity. */
+ ir_type *ent_owner; /**< The owner of this entity. */
} scalars_t;
if (get_irn_op(succ) == op_Sel) {
entity *ent = get_Sel_entity(succ);
- type *ent_type;
+ ir_type *ent_type;
if (get_entity_link(ent) == ADDRESS_TAKEN)
continue;
ir_mode **modes;
set *set_ent;
pset *sels;
- type *ent_type;
+ ir_type *ent_type;
ir_graph *rem;
if (! get_opt_scalar_replacement())